Skip to content

Commit 5384258

Browse files
akiyksJonathan Corbet
authored andcommitted
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. Signed-off-by: Akira Yokosawa <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent af3e4a5 commit 5384258

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

scripts/check-variable-fonts.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
# suggestions if variable-font files of "Noto CJK" fonts are in the list of
2121
# fonts accessible from XeTeX.
2222
#
23-
# Assumption:
24-
# File names are not modified from those of upstream Noto CJK fonts:
25-
# https://github.com/notofonts/noto-cjk/
26-
#
2723
# References:
2824
# [1]: https://lore.kernel.org/r/[email protected]/
2925
# [2]: https://lore.kernel.org/r/[email protected]/
@@ -96,13 +92,15 @@
9692

9793
export XDG_CONFIG_HOME=${FONTS_CONF_DENY_VF}
9894

99-
vffonts=`fc-list -b | grep -iE 'file: .*noto.*cjk.*-vf' | \
100-
sed -e 's/\tfile:/ file:/' -e 's/(s)$//' | sort | uniq`
95+
notocjkvffonts=`fc-list : file family variable | \
96+
grep 'variable=True' | \
97+
grep -E -e 'Noto (Sans|Sans Mono|Serif) CJK' | \
98+
sed -e 's/^/ /' -e 's/: Noto S.*$//' | sort | uniq`
10199

102-
if [ "x$vffonts" != "x" ] ; then
100+
if [ "x$notocjkvffonts" != "x" ] ; then
103101
echo '============================================================================='
104102
echo 'XeTeX is confused by "variable font" files listed below:'
105-
echo "$vffonts"
103+
echo "$notocjkvffonts"
106104
echo
107105
echo 'For CJK pages in PDF, they need to be hidden from XeTeX by denylisting.'
108106
echo 'Or, CJK pages can be skipped by uninstalling texlive-xecjk.'

0 commit comments

Comments
 (0)