Skip to contentSkip to conversation

docs: scripts/check-variable-fonts.sh: Improve commands for detection

PATCH Applied Akira Yokosawa 2 participants 2 messages Apr 27, 2024 – May 2, 2024 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: scripts/check-variable-fonts.sh: Improve commands for detection

As mentioned in "Assumption:", current grep expression can't catch font files whose names are changed from upstream "Noto CJK fonts".

To avoid false negatives, use command of the form:

fc-list : file family variable

, where ":" works as a wildcard pattern.

Variable fonts can be detected by filtering the output with "variable=True" and "Noto CJK" font-family variants.

---
 scripts/check-variable-fonts.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
scripts/check-variable-fonts.sh +6 -8
index 12765e54e4f3..ce63f0acea5f 100755
@@ -20,10 +20,6 @@
 # suggestions if variable-font files of "Noto CJK" fonts are in the list of
 # fonts accessible from XeTeX.
 #
-# Assumption:
-# File names are not modified from those of upstream Noto CJK fonts:
-#     https://github.com/notofonts/noto-cjk/
-#
 # References:
 # [1]: https://lore.kernel.org/r/[email protected]/
 # [2]: https://lore.kernel.org/r/[email protected]/
@@ -96,13 +92,15 @@
 
 export XDG_CONFIG_HOME=${FONTS_CONF_DENY_VF}
 
-vffonts=`fc-list -b | grep -iE 'file: .*noto.*cjk.*-vf' | \
-	 sed -e 's/\tfile:/  file:/' -e 's/(s)$//' | sort | uniq`
+notocjkvffonts=`fc-list : file family variable | \
+		grep 'variable=True' | \
+		grep -E -e 'Noto (Sans|Sans Mono|Serif) CJK' | \
+		sed -e 's/^/    /' -e 's/: Noto S.*$//' | sort | uniq`
 
-if [ "x$vffonts" != "x" ] ; then
+if [ "x$notocjkvffonts" != "x" ] ; then
 	echo '============================================================================='
 	echo 'XeTeX is confused by "variable font" files listed below:'
-	echo "$vffonts"
+	echo "$notocjkvffonts"
 	echo
 	echo 'For CJK pages in PDF, they need to be hidden from XeTeX by denylisting.'
 	echo 'Or, CJK pages can be skipped by uninstalling texlive-xecjk.'

base-commit: fcb5bcefdbfbd939bf4edfa71182df0b56d20a49

Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 9 lines · Akira Yokosawa

As mentioned in "Assumption:", current grep expression can't catch font files whose names are changed from upstream "Noto CJK fonts".

To avoid false negatives, use command of the form:

fc-list : file family variable

, where ":" works as a wildcard pattern.

Quoted 7 lines

Variable fonts can be detected by filtering the output with "variable=True" and "Noto CJK" font-family variants.

---
 scripts/check-variable-fonts.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Applied, thanks.

jon