aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Yokosawa <akiyks@gmail.com>2024-04-27 17:24:11 +0900
committerJonathan Corbet <corbet@lwn.net>2024-05-02 10:14:52 -0600
commit5384258f4ef0c27cc9d5255ce4992f13656e215d (patch)
treea54c1fbdf1fb702146e639cb6a7514e36ead7d33
parentaf3e4a5ab9a017da9cf624791629e2df710a171c (diff)
downloadlinux-5384258f4ef0c27cc9d5255ce4992f13656e215d.tar.gz
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 <akiyks@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/c62ba2e6-c124-4e91-8011-cb1da408a3c5@gmail.com
-rwxr-xr-xscripts/check-variable-fonts.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/check-variable-fonts.sh b/scripts/check-variable-fonts.sh
index 12765e54e4f34f..ce63f0acea5fd6 100755
--- a/scripts/check-variable-fonts.sh
+++ b/scripts/check-variable-fonts.sh
@@ -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/8734tqsrt7.fsf@meer.lwn.net/
# [2]: https://lore.kernel.org/r/1708585803.600323099@f111.i.mail.ru/
@@ -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.'