Re: [PATCH] docs: Detect variable fonts and suggest removing them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Akira,

On 3/23/24 05:02, Akira Yokosawa wrote:
> xelatex doesn't understand variable font format.  Recent deployment
> of variable Noto CJK fonts in Fedora and openSUSE tumbleweed breaks
> builds of translations.pdf.
> 
> To help developers work around the build error, add a script for
> checking existence of variable form of those fonts and emitting
> suggestions.  Invoke it in the error path of "make pdfdocs" so that it
> is activated only when PDF build actually fails.
> 
> Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
> Reported-by: Jonathan Corbet <corbet@xxxxxxx>
> Link: https://lore.kernel.org/r/8734tqsrt7.fsf@xxxxxxxxxxxx/
> Reported-by: "Иван Иванович" <relect@xxxxx>
> Link: https://lore.kernel.org/linux-doc/1708585803.600323099@xxxxxxxxxxxxxx/
> ---

[snip]

> ---
> Cc: linux-doc@xxxxxxxxxxxxxxx
> ---
>  Documentation/Makefile          |  2 +-
>  MAINTAINERS                     |  1 +
>  scripts/check-variable-fonts.sh | 30 ++++++++++++++++++++++++++++++
>  3 files changed, 32 insertions(+), 1 deletion(-)
>  create mode 100755 scripts/check-variable-fonts.sh
> 

I don't have much to say about the patch except that it seems like a good idea...

However, some of the terminology could be improved IMO.
E.g., "variable type" or "variable font" should be something like
variable-width font or proportionally-spaced font.

"static ones" should be something like fixed-space fonts or monospaced fonts.

Unless I just completely don't understand the uses of "variable" and "static" here.

> diff --git a/scripts/check-variable-fonts.sh b/scripts/check-variable-fonts.sh
> new file mode 100755
> index 000000000000..775800edb9fc
> --- /dev/null
> +++ b/scripts/check-variable-fonts.sh
> @@ -0,0 +1,30 @@
> +#!/bin/sh
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# For "make pdfdocs", recent trend of deploying variable type of
> +# "Noto Sans CJK" and "Noto Serif CJK" fonts breaks xelatex, which does
> +# not understand variable fonts.
> +#
> +# It is hard to distinguish variable fonts from static ones in the preamble
> +# of LaTeX source code.  Instead, this script is invoked in the error path
> +# of "make pdfdocs" and emit suggestions if such font files are found.
> +#
> +# Assumption:
> +# File names are not changed from those of upstream Noto CJK fonts:
> +#     https://github.com/notofonts/noto-cjk/
> +
> +vffonts=`fc-list -b | grep -i noto | grep -i cjk | grep -F -i -e "-vf" | \
> +	 sort | uniq | sed -e 's/\tfile:/  file:/' | sed -e 's/(s)$//'`
> +
> +if [ "x$vffonts" != "x" ] ; then
> +	echo "====================================================================="
> +	echo "Detected variable form of Noto CJK fonts incompatible with xelatex:"
> +	echo "$vffonts"
> +	echo "If you need CJK contents in PDF, remove them and install static ones."
> +	echo "Otherwise, get rid of texlive-xecjk."
> +	echo "====================================================================="
> +fi
> +
> +# As this script is invoked from Makefile's error path, always error exit
> +# even if no variable font is detected.
> +exit 1
> 
> base-commit: b8cfda5c9065cd619a97c17da081cbfab3b1e756

Thanks.
-- 
#Randy




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux