Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2284374pxt; Sun, 8 Aug 2021 18:23:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP9f560huXiAySON6tMkYHHza7U0hvLgZnJyZzqVpZBWQMGtmdkzEST4chB7ULYRNYyIXz X-Received: by 2002:a05:6402:5161:: with SMTP id d1mr4230437ede.50.1628472238231; Sun, 08 Aug 2021 18:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628472238; cv=none; d=google.com; s=arc-20160816; b=qf02WSontkbtebuQ1cuQdBwKNAtAxpcrQFtZ1WyclqtV4ObQv5u5rOTIoM17nu7YPf tvHeaOXSJvohKwAoYXg3jbK/gxxdF8htnJWvJovSa2zAR5EfLx1wcLtyh72PilgHQZL9 x3o4GrD8+nhnig1XvHApKTik8Qo6XohCkwupSWQ57ONfU2vTKjj+xPxp49m5f8ZjdoYz 9zzxlB2tp9OmqokJzpHUtjIvCMe5VgptIWuLzkn3xuBfy0BOmijjQegHi2ip0p+2g5Ab P7zaflY/t2g8a8ONM/xO6DZwvk6gK0qj1R/SlxDPGhDSTsYQIcvIQTYgB6cnbTWcbnJQ twxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=pYYxiw41X17NhD1Q5oNmXyZafkiZ20OypLI54Gm/l6w=; b=w3kTaV/QQ6/43bRGIL7LMuJU52Ycau8pMZHdTGLDD4EZhh475s3Wthp0GWVe1sLMgd z+fpizplA1I3u1kunBRPtm2Rws22F6lE3TgbyjTeyeuW2QGZ/5x0VpTrNSas1bJWi5B/ jNYacbzb57o9wyzhfs8pe9dfusBkRTSzs+jaP6UbrGJQUp+rVfnQUn5b+3q4bqZRdPzN NexKuJiAIRBSoIHhanYjSMO6lvja4W8QVEtDFUefq0BbaUKC0YSdGfD5eONoH53qwIs2 0oXe54EVVf7Xxosd6U4tP3ZVuWb8L5AI13zxdHWcYI5IByM3XsXLRi/38ynop2oC+res x+FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m0glI4mt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si15544117edx.577.2021.08.08.18.23.33; Sun, 08 Aug 2021 18:23:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m0glI4mt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232570AbhHIBRZ (ORCPT + 99 others); Sun, 8 Aug 2021 21:17:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231168AbhHIBRY (ORCPT ); Sun, 8 Aug 2021 21:17:24 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF32FC061757; Sun, 8 Aug 2021 18:17:03 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id q2so14613688plr.11; Sun, 08 Aug 2021 18:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=pYYxiw41X17NhD1Q5oNmXyZafkiZ20OypLI54Gm/l6w=; b=m0glI4mtBx6gFQq7XMZbzWzpo2QRbQ5tvHAayhoG3rePzTciRkb4aOzdynj+DXti0X nTlMMB9pQo8sS2OWyRSvJUO9u1Zvz2ghDQHWPc/d1Ccg3QCJ1pEfaRcSy8cKLZZFZoRP hojFkdOnZ5b216Ykb6e6sUHC0x5PRWCKFtTpVniwAqVb20F4Ugx4SFP369IXh7BUr+4O +ZljzuH34cczn4FsMhdHgQsyQGsvKqpgv5FfnR6q+/E4+5OW8p+mHagCu+cA0kAqwUWB 8Z2yKVeCK3kJs8CeL10SC+umJsnWCGhCAzYtjxwzeGiGvnsvNIaIPr+xB1RZlgBJbqQ7 SkWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pYYxiw41X17NhD1Q5oNmXyZafkiZ20OypLI54Gm/l6w=; b=ejgzmpp6W1l5UAM/r57bO0ZzHW7TH2WTcO3n3Lg82OhEX9HERZQFN9khRqa/maIJtx iI0M/mwH1pt5csiFrxv7Itgk37QnD3cqLq/2S5CgoymvGl4VciX9J9AGH/T2QTtTYElp ZvjXVtdEO3AER3GYCsplwvN/N/8bAL55QLcMZz1D5W3wNco1N0D3SckH0+1YIcgMFsQ6 Ep1ZsC8WE5dfX/bmO2EeLvcUgpW+tZFOke1eTrXb0TUj/RHD+/SQqnQiwy7Xs5ugq/Qk tEIArp4yQy+J9tcsug0uNKiu1gBMJYdzQKbgpcuv+7JGSn++avj+t/K1hfUho8cHuxko 6wrA== X-Gm-Message-State: AOAM533daJ3ALuMH90JPZb4j5FNa1af6ybhXCkWhxNE/GxSLPHN/nFiD +HlFLcKhc9EE6FvolotGyMZ152uNeJs= X-Received: by 2002:a63:1155:: with SMTP id 21mr574134pgr.346.1628471823431; Sun, 08 Aug 2021 18:17:03 -0700 (PDT) Received: from [192.168.11.2] (KD106167171201.ppp-bb.dion.ne.jp. [106.167.171.201]) by smtp.gmail.com with ESMTPSA id v16sm9573074pje.24.2021.08.08.18.17.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Aug 2021 18:17:03 -0700 (PDT) Subject: [PATCH v4 3/9] docs: pdfdocs: Choose Serif font as CJK mainfont if possible To: Jonathan Corbet Cc: Mauro Carvalho Chehab , "Wu X.C." , SeongJae Park , Hu Haowen , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: <39d0fb0f-b248-bca4-2dac-df69e8d697b1@gmail.com> From: Akira Yokosawa Message-ID: <5e454140-5d0c-35d4-8c31-3ffb2420793a@gmail.com> Date: Mon, 9 Aug 2021 10:17:00 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <39d0fb0f-b248-bca4-2dac-df69e8d697b1@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Noto Serif CJK SC" and its variants suit better with the roman font of Latin letters. On some distros such as Fedora, it is possible to partially install "Noto Sans CJK" fonts. So, if the Serif fonts are not found on the system, fall back to the Sans fonts. Signed-off-by: Akira Yokosawa --- Documentation/conf.py | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index 24e5427588e7..980be06df723 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -360,20 +360,48 @@ latex_elements['preamble'] += ''' \\IfFontExistsTF{Noto Sans CJK SC}{ % This is needed for translations \\usepackage{xeCJK} - \\setCJKmainfont{Noto Sans CJK SC} + \\IfFontExistsTF{Noto Serif CJK SC}{ + \\setCJKmainfont{Noto Serif CJK SC} + }{ + \\setCJKmainfont{Noto Sans CJK SC} + } \\setCJKsansfont{Noto Sans CJK SC} \\setCJKmonofont{Noto Sans Mono CJK SC} % CJK Language-specific font choices - \\newCJKfontfamily[SCmain]\\scmain{Noto Sans CJK SC} + \\IfFontExistsTF{Noto Serif CJK SC}{ + \\newCJKfontfamily[SCmain]\\scmain{Noto Serif CJK SC} + \\newCJKfontfamily[SCserif]\\scserif{Noto Serif CJK SC} + }{ + \\newCJKfontfamily[SCmain]\\scmain{Noto Sans CJK SC} + \\newCJKfontfamily[SCserif]\\scserif{Noto Sans CJK SC} + } \\newCJKfontfamily[SCsans]\\scsans{Noto Sans CJK SC} \\newCJKfontfamily[SCmono]\\scmono{Noto Sans Mono CJK SC} - \\newCJKfontfamily[TCmain]\\tcmain{Noto Sans CJK TC} + \\IfFontExistsTF{Noto Serif CJK TC}{ + \\newCJKfontfamily[TCmain]\\tcmain{Noto Serif CJK TC} + \\newCJKfontfamily[TCserif]\\tcserif{Noto Serif CJK TC} + }{ + \\newCJKfontfamily[TCmain]\\tcmain{Noto Sans CJK TC} + \\newCJKfontfamily[TCserif]\\tcserif{Noto Sans CJK TC} + } \\newCJKfontfamily[TCsans]\\tcsans{Noto Sans CJK TC} \\newCJKfontfamily[TCmono]\\tcmono{Noto Sans Mono CJK TC} - \\newCJKfontfamily[KRmain]\\krmain{Noto Sans CJK KR} + \\IfFontExistsTF{Noto Serif CJK KR}{ + \\newCJKfontfamily[KRmain]\\krmain{Noto Serif CJK KR} + \\newCJKfontfamily[KRserif]\\krserif{Noto Serif CJK KR} + }{ + \\newCJKfontfamily[KRmain]\\krmain{Noto Sans CJK KR} + \\newCJKfontfamily[KRserif]\\krserif{Noto Sans CJK KR} + } \\newCJKfontfamily[KRsans]\\krsans{Noto Sans CJK KR} \\newCJKfontfamily[KRmono]\\krmono{Noto Sans Mono CJK KR} - \\newCJKfontfamily[JPmain]\\jpmain{Noto Sans CJK JP} + \\IfFontExistsTF{Noto Serif CJK JP}{ + \\newCJKfontfamily[JPmain]\\jpmain{Noto Serif CJK JP} + \\newCJKfontfamily[JPserif]\\jpserif{Noto Serif CJK JP} + }{ + \\newCJKfontfamily[JPmain]\\jpmain{Noto Sans CJK JP} + \\newCJKfontfamily[JPserif]\\jpserif{Noto Sans CJK JP} + } \\newCJKfontfamily[JPsans]\\jpsans{Noto Sans CJK JP} \\newCJKfontfamily[JPmono]\\jpmono{Noto Sans Mono CJK JP} % Define custom macros to on/off CJK @@ -387,6 +415,7 @@ latex_elements['preamble'] += ''' \\newcommand{\\kerneldocBeginTC}{% \\begingroup% \\tcmain% + \\renewcommand{\\CJKrmdefault}{TCserif}% \\renewcommand{\\CJKsfdefault}{TCsans}% \\renewcommand{\\CJKttdefault}{TCmono}% } @@ -394,6 +423,7 @@ latex_elements['preamble'] += ''' \\newcommand{\\kerneldocBeginKR}{% \\begingroup% \\krmain% + \\renewcommand{\\CJKrmdefault}{KRserif}% \\renewcommand{\\CJKsfdefault}{KRsans}% \\renewcommand{\\CJKttdefault}{KRmono}% } @@ -401,6 +431,7 @@ latex_elements['preamble'] += ''' \\newcommand{\\kerneldocBeginJP}{% \\begingroup% \\jpmain% + \\renewcommand{\\CJKrmdefault}{JPserif}% \\renewcommand{\\CJKsfdefault}{JPsans}% \\renewcommand{\\CJKttdefault}{JPmono}% } -- 2.17.1