From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67CA9C433B4 for ; Fri, 21 May 2021 07:54:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47F68600CC for ; Fri, 21 May 2021 07:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbhEUH4I (ORCPT ); Fri, 21 May 2021 03:56:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:41884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231301AbhEUH4I (ORCPT ); Fri, 21 May 2021 03:56:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CA5636135B; Fri, 21 May 2021 07:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621583685; bh=q/Uy9Bki/OPO7BqB5Ad/aj1S8JOWQCXav+mJLUNTH3Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bt/+atbMIe3qCOQt6SaZvqsnHyJB20KtXdG/eJH8hzxaIC2F+nZmGBFmr2uBQUGF5 Gr6PlXp5UdgEWirc06ibXZNfoDCTYnnJQWQxr2ZhLfM3KirlMwqY0F1Dy8GW+HIOb7 WqSDJsrPFUlYwLgV4gTIUzjzQrNOQErxoDokPUEFLhPRc201Hhn97CoukeiYz3p/qT BNdiVZAvDyEUUiUCMu0QGAs1sDuQpuhgcStW0cRejJ+xywIMjrsRRBWWo7Y32fA8fl AYCX3c8fTqSzlmPrN1bjoKJEYwp1Zt+eQ5fFs96x3evGUgaGWNcA1pxRvUYrgAFWkB llvTxQOzl4q5A== Date: Fri, 21 May 2021 09:54:42 +0200 From: Mauro Carvalho Chehab To: Akira Yokosawa Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] docs: sphinx-pre-install: Reword warning on installing cjk font Message-ID: <20210521095442.33957ff3@coco.lan> In-Reply-To: References: X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org HI Akira, Em Fri, 21 May 2021 16:14:19 +0900 Akira Yokosawa escreveu: > Installing a ckj font as recommended by the warning message causes > generated latex code to have: > > % This is needed for translations > \usepackage{xeCJK} > \setCJKmainfont{Noto Sans CJK SC} > > in its preamble even for an English document. Yes. The same LaTeX configuration is applied to all documents. While the standard Sphinx logic allows just one conf.py, there's a logic on Linux that allows a per-directory configuration. Perhaps it would be possible to set the font just for translations. Yet, this can't be easily done per-translation - Italian translation for instance doesn't need CJK fonts. > The package "xeCJK" changes wide characters' appearance including > apostrophe (single quote) and double quotes, and it changes line-break > behavior with regard to the boundary of narrow and wide characters. > > This greatly degrades readability of English PDFs typeset by xelatex. Hmm... could you give an example where it looks ugly? At least on the documents I use to check the PDF output, I was unable to see any big issue. Regards, Mauro > > As a band-aid help, reword the message and let the user at least be > aware of the degradation. > > Signed-off-by: Akira Yokosawa > --- > Hello, > > I'm a newcomer to kernel-doc who started trying sphinx this week. > I have both sphinx 2.4.4 and 1.7.9 installed. > For pdfdocs, I use 2.4.4. > > "make htmldocs" was fairly easy, but I struggled a while to get > PDFs as I expected. > > The culprit turned out to be the "xeCJK" package mentioned above > in the change log. It appears in all the generated latex files > due to the "Noto Sans CJK" font I have installed seeing the warning > message from sphinx-pre-install. > > By uninstalling the font, I can now build the PDF as I expect. > > The reworded message is just a band-aid help. > > In the long term, I see that rst2pdf tool is your hope to avoid > LaTeX altogether. But it would be nice if you can enable xeCJK only > for the translations document. Can sphinx permit such language > choice per subdirectory (or hopefully per .rst file)? > > Thanks, Akira > -- > scripts/sphinx-pre-install | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install > index fe92020d67e3..b3c7da2b8ad2 100755 > --- a/scripts/sphinx-pre-install > +++ b/scripts/sphinx-pre-install > @@ -101,7 +101,12 @@ sub check_missing(%) > } > > if ($is_optional) { > - print "Warning: better to also install \"$prog\".\n"; > + if ($prog =~ /cjk/ ) { > + print "Warning: For translations PDF, better to install \"$prog\".\n"; > + print "However, doing so will *degrade* English PDF typesetting.\n"; > + } else { > + print "Warning: better to also install \"$prog\".\n"; > + } > } else { > print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; > } Thanks, Mauro