public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: corbet@lwn.net, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 04/21] scripts: check-variable-fonts.sh: convert to Python
Date: Thu, 18 Sep 2025 10:51:28 +0200	[thread overview]
Message-ID: <20250918105124.3728661a@foz.lan> (raw)
In-Reply-To: <eaab7ba4-f23c-4c33-b9d1-faae73c136a4@gmail.com>

Em Thu, 18 Sep 2025 08:22:44 +0900
Akira Yokosawa <akiyks@gmail.com> escreveu:

> Hi,
> 
> On Wed, 17 Sep 2025 10:48:18 +0200, Mauro Carvalho Chehab wrote:
> > Em Wed, 17 Sep 2025 10:09:05 +0900
> > Akira Yokosawa <akiyks@gmail.com> escreveu:
> >   
> >> On Tue, 16 Sep 2025 12:22:40 +0200, Mauro Carvalho Chehab wrote:  
> >>> This script handle errors when trying to build translations
> >>> with make pdfdocs.
> >>>
> >>> As part of our cleanup work to remove hacks from docs Makefile,
> >>> convert this to python, preparing it to be part of a library
> >>> to be called by sphinx-build-wrapper.
> >>>
> >>> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>  
> >>
> >> I could apply up to 05/21 of v6 and did some quick tests under
> >> Fedora (where Noto CJK VF fonts are installed).
> >>
> >> At 3/21, "./scripts/check-variable-fonts.sh" doesn't say a word.
> >>
> >> At 4/21, "./scripts/check-variable-fonts.py" complains:  
> > 
> > I got a little bit confused with the above. I guess you picked the
> > wrong patch numbers, but yeah, there is a bisect issue, caused by
> > the part reorder I did moving this change to happen before adding
> > the script. Basically, I updated docs Makefile the wrong way.
> > 
> > Thanks for pointing it!
> > 
> > For v7 I'll ensure that all patches will properly print the suggestions
> > from the script.
> >   
> >> =============================================================================
> >> XeTeX is confused by "variable font" files listed below:
> >>     /usr/share/fonts/google-noto-sans-cjk-vf-fonts/NotoSansCJK-VF.ttc
> >>     /usr/share/fonts/google-noto-sans-mono-cjk-vf-fonts/NotoSansMonoCJK-VF.ttc
> >>     /usr/share/fonts/google-noto-serif-cjk-vf-fonts/NotoSerifCJK-VF.ttc
> >>
> >> For CJK pages in PDF, they need to be hidden from XeTeX by denylisting.
> >> Or, CJK pages can be skipped by uninstalling texlive-xecjk.
> >>
> >> For more info on denylisting, other options, and variable font, see header
> >> comments of scripts/check-variable-fonts.py.
> >> =============================================================================
> >>
> >> Of course, I have followed the suggestions in the header comments.  
> > 
> > I didn't try to follow the suggestions to solve the issue on Fedora yet.
> > It is on my todo list to test it.
> > 
> > The new script has an exact copy of the instructions of the previous one.
> > 
> > So, up to patch 09/21 from this series, there won't be any change at
> > doc build, except for the script conversion and some code cleanups
> > and reordering.
> > 
> > Patch 09/21 moves the env logic of FONTS_CONF_DENY_VF to the wrapper.
> > So, in thesis, fixing it before-after the series shouldn't have any
> > impact (I didn't test yet. Will do on my next respin). Btw, we should
> > probably document it at make help.
> > 
> > If the instructions from the header is wrong, we need to update it
> > on a separate patch series.
> >   
> 
> I have tested v7.
> 
> With v7 fully applied, it is now possible to build translations.pdf on
> Fedora.  Nice!
> 
> HOWEVER, running
> 
>     ./tools/docs/check-variable-fonts.py
> 
> still complains.  I'm not sure but there might be some minor issue (typo?)
> in the translation from .sh into .py ???
> 
> So I have to keep the NAK on v7's 7/24 ("scripts: check-variable-fonts.sh:
> convert to Python") for the moment.
> 
> Please run the script under a terminal session and see what happens ...

Yeah, there was a typo there. I fixed it for the next respin.

To better allow running it manually, I'm adding to the tool a new command
line argument:

	$ tools/docs/check-variable-fonts.py -h
	...
	options:
	  -h, --help         show this help message and exit
	  --deny-vf DENY_VF  XDG_CONFIG_HOME dir containing fontconfig/fonts.conf file

And changed the class __init__ logic to optionally use it:

    def __init__(self, deny_vf=None):
        if not deny_vf:
            deny_vf = os.environ.get('FONTS_CONF_DENY_VF', "~/deny-vf")

This way, it will keep using FONTS_CONF_DENY_VF (defaulting to ~/deny-vf),
yet allowing it to be overriden via command line:

	$ tools/docs/check-variable-fonts.py
	<no output>

	$ tools/docs/check-variable-fonts.py --deny-vf ~/deny-vf/
	<no output>

	$ tools/docs/check-variable-fonts.py --deny-vf ~/dont-deny-vf/
	=============================================================================
	XeTeX is confused by "variable font" files listed below:
	    /usr/share/fonts/google-noto-sans-cjk-vf-fonts/NotoSansCJK-VF.ttc
	    /usr/share/fonts/google-noto-sans-mono-cjk-vf-fonts/NotoSansMonoCJK-VF.ttc
	    /usr/share/fonts/google-noto-serif-cjk-vf-fonts/NotoSerifCJK-VF.ttc
	
	For CJK pages in PDF, they need to be hidden from XeTeX by denylisting.
	Or, CJK pages can be skipped by uninstalling texlive-xecjk.
	
	For more info on denylisting, other options, and variable font, run:
	
	    tools/docs/check-variable-fonts.py -h
	=============================================================================

Thanks,
Mauro

  reply	other threads:[~2025-09-18  8:51 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 10:22 [PATCH v6 00/21] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 01/21] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 02/21] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 03/21] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 04/21] scripts: check-variable-fonts.sh: convert to Python Mauro Carvalho Chehab
2025-09-17  1:09   ` Akira Yokosawa
2025-09-17  8:48     ` Mauro Carvalho Chehab
2025-09-17 23:22       ` Akira Yokosawa
2025-09-18  8:51         ` Mauro Carvalho Chehab [this message]
2025-09-16 10:22 ` [PATCH v6 05/21] tools/docs: check-variable-fonts.py: split into a lib and an exec file Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 06/21] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 07/21] tools/docs: python_version: move version check from sphinx-pre-install Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 08/21] tools/docs: python_version: drop a debug print Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 09/21] tools/docs: python_version: allow check for alternatives and bail out Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 10/21] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-09-17  8:35   ` Akira Yokosawa
2025-09-17  8:45     ` Akira Yokosawa
2025-09-17 15:11     ` Jonathan Corbet
2025-09-17 23:43       ` Akira Yokosawa
2025-09-18  8:24         ` Mauro Carvalho Chehab
2025-09-17 15:18     ` Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 11/21] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 12/21] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 13/21] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 14/21] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 15/21] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 16/21] tools/docs: sphinx-build-wrapper: Fix output for duplicated names Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 17/21] docs: add support to build manpages from kerneldoc output Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 18/21] tools: kernel-doc: add a see also section at man pages Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 19/21] scripts: kdoc_parser.py: warn about Python version only once Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 20/21] tools/docs: sphinx-* break documentation bulds on openSUSE Mauro Carvalho Chehab
2025-09-16 10:22 ` [PATCH v6 21/21] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-09-16 10:31 ` [PATCH v6 00/21] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-16 15:47 ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250918105124.3728661a@foz.lan \
    --to=mchehab+huawei@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox