Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3595048pxv; Mon, 19 Jul 2021 04:18:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJsOJoO9onkqFA+2w5aoIQXch5ILexuJ14/QWBsY9ZVhJwe2XzUgTMo7mfFDPd5KJyrC51 X-Received: by 2002:a05:6402:686:: with SMTP id f6mr25079421edy.127.1626693526312; Mon, 19 Jul 2021 04:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626693526; cv=none; d=google.com; s=arc-20160816; b=spSGvAvfYrZ0tEgu++IwYYcJe/cdKpOlDOP77qLmaY0guAsVr8niGm+ItEj8mKyLry xJeHCFxE3EEAGoYqUMZ8wcFuWct6LEwQNGEHRD5Kqed3p/NAqk49v9NAZAHZWEtwmzVC xI6LAR7LqcrgVbJELk8dJnA/rctEJ8IFC3kmq2cHTC9QXK03TiTnOVXXIwuRupQrzEAN n93dH0akcjFX8f3MIbbF6kfDeRomAMDFRpKpUcfb0koW8nO+Divius9HPoP8Vz3PXu6R c6lUMVM2lNQeuQwukjn/8EMiQypPOz5SDQK3LyeXnUrm1Sxa0zM0RONV9+ORNV8KWgCT fzgg== 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=RbZ1fp7+3stRY8Uk9v8nVPrVKsRUvay5H0101Cor1uw=; b=p47lQZ5Zdg2xP7k7Q3K9gOSDV4NBhstAB9q372t7IYz0efpKdr3MuFmA9Scx3HT3zk +l17x950jxuEBzVNjYWWdbGXqSN2in9hWSUMNVq9iYD5AE0qzukghZ4ayoBegTFZ6191 8qqCMbJTzIiJ6pSLFWadjRiR897IDzH4I3OTWQ3/vs4lSUzKUVDifeHXa+G2O4fqdZ9c em/sbslKWRn/kmVCIDL2VXOuVYKOPu+xIIzwdoDl4Wlv0LDT7Ft4dOFjmQ6FiTeZ6AT/ Kef/K3Oxq4a54dj/xlrPtypmO0u1szyThrGukmUlhiLU7x4ggDtQ25eoJRr4Ck56u64c BaeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=s4ToIQa7; 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 ee47si21739714edb.7.2021.07.19.04.18.23; Mon, 19 Jul 2021 04:18:46 -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=s4ToIQa7; 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 S236427AbhGSKgd (ORCPT + 99 others); Mon, 19 Jul 2021 06:36:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235999AbhGSKgb (ORCPT ); Mon, 19 Jul 2021 06:36:31 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3183C061574; Mon, 19 Jul 2021 03:27:31 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id a6so11326932pgw.3; Mon, 19 Jul 2021 04:17:10 -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=RbZ1fp7+3stRY8Uk9v8nVPrVKsRUvay5H0101Cor1uw=; b=s4ToIQa77FMsUGF4lYXMm5uZ08NBZ4YXQmu156fcz17EtNkGjmgn1I8PurEN31ZUQT 3NeMOE9wW9Q0rqxLn5lktzPmUa7nSYQRmOfDWeV8KAhwaDj1NTtyJcA9oKiGG/U164LO /c/eFte6RQNv0O9c5/Ovt4D9P5IKKB2KKngxRqbYjXrVcHyUsUAHofzvzTjeK/IryZFd GmFYF/5kXjFMSUdLNgUspF6cPE/XmDdOoW4klrFwhonQHyq2SesrfB0UKfCV/u8U0ieL gMhJuWguZw9ivuQtOizZWsnI1sUDeXxaDKwCEqvYxNFxsJaBtugQF7MtbF2eZqGwm6Dc xedg== 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=RbZ1fp7+3stRY8Uk9v8nVPrVKsRUvay5H0101Cor1uw=; b=CZcAlzDNfQuZNn/PxqsvKBzT+SHe3OjtS1zyC3Nk/PfK2yGr6/G8YMrSsK6ZG7CcT2 PhLL+hqKI4O1r5wGz0O6JLX5dU32OsgrZtb+9rxLLg3THWHYlhboRdyqH3aS16Z3472b iWta/YcvM6LbbYXBL3ARjWdupYwmIul8idO2Mhy1ccrLWz4jzUMolnZJs7j8TDEl65hz z9nid1tc0+CITti+mbDkA1adsnyxJmgIOowm5nBTKuK8iGYWgM8TCUZeWhMaFvJ5A2nS grzNnOiJy5uXQseL2raHNmBdqHf89LJx3JhC5ytFB0ffQTfL7UrTz0a5mty2CyzAswX3 lgxg== X-Gm-Message-State: AOAM533fBq+/zIrfHnEC0XUaWtVecuFKaF1gBehqPgNiTKzH4qRLAtk/ znMlFlTY19cln5Gpk52H3Ura2RZVUMI= X-Received: by 2002:a62:e90b:0:b029:30e:4530:8dca with SMTP id j11-20020a62e90b0000b029030e45308dcamr25514964pfh.17.1626693430050; Mon, 19 Jul 2021 04:17:10 -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 p25sm19633277pff.120.2021.07.19.04.17.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jul 2021 04:17:09 -0700 (PDT) Subject: [RFC PATCH v2 6/7] docs: pdfdocs: Add optional choices for Korean monospace font To: Jonathan Corbet , Mauro Carvalho Chehab , "Wu X.C." , SeongJae Park Cc: Hu Haowen , Shinwoo Lee , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Akira Yokosawa References: <20ff8a65-6a5c-c062-fe1a-0f5c5ddc813c@gmail.com> From: Akira Yokosawa Message-ID: Date: Mon, 19 Jul 2021 20:17:06 +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: <20ff8a65-6a5c-c062-fe1a-0f5c5ddc813c@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Candidates of alternative choices of a *true* monospace font would be "D2Coding", "Sarasa Mono K", or "Unifont" font. The alignment of Korean ascii-art figures matters when the optional conf.py under Dodumentation/translations/ is effective. So, add conditional settings in the local config so that when one of the candidate fonts is found, it is used instead of "Noto Sans Mono CJK KR". As xeCJK does not provide a macro to redefine an existing CJK font family, define a wrapper macro "\setKRmono" and use it in the "\kerneldocBeginKR" macro. Also mention the nice-to-have monospace Hangul fonts in the header comment in conf.py. Signed-off-by: Akira Yokosawa --- Documentation/conf.py | 4 +++- Documentation/translations/conf.py | 34 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Documentation/conf.py b/Documentation/conf.py index 8a715765dada..1368c64e3993 100644 --- a/Documentation/conf.py +++ b/Documentation/conf.py @@ -382,6 +382,8 @@ latex_elements['preamble'] +=3D ''' \\scserif% } \\newcommand{\\kerneldocEndSC}{\\endgroup} + \\newcommand{\\setKRmono}{% For alternative Hangul monospace font + \\renewcommand{\\CJKttdefault}{KRmono}} \\newcommand{\\kerneldocBeginKR}{% \\begingroup% \\xeCJKDeclareCharClass{HalfLeft}{`=E2=80=9C,`=E2=80=98}% @@ -389,7 +391,7 @@ latex_elements['preamble'] +=3D ''' \\krserif% \\renewcommand{\\CJKrmdefault}{KRserif}% \\renewcommand{\\CJKsfdefault}{KRsans}% - \\renewcommand{\\CJKttdefault}{KRmono}% + \\setKRmono% \\xeCJKsetup{CJKspace =3D true} % For inter-phrase space } \\newcommand{\\kerneldocEndKR}{\\endgroup} diff --git a/Documentation/translations/conf.py b/Documentation/translati= ons/conf.py index 92cdbba74229..0e171eed1862 100644 --- a/Documentation/translations/conf.py +++ b/Documentation/translations/conf.py @@ -3,10 +3,42 @@ =20 # -- Additinal options for LaTeX output --------------------------------= -- # font config for ascii-art alignment - +# +# Note: Ascii-art figures involving Hangul characters need optional +# monospace font. (Hangul in "Noto Sans Mono CJK" is slightly narr= ow.) +# If you'd like to see properly aligned ascii-art figures in Korea= n +# translations, you need to install a *true* monospace Hangul font= =2E +# +# Candidates of such a monospace font which covers Hangul: +# 1) D2Coding: Availabe at +# https://github.com/naver/d2codingfont/releases/latest +# 2) Sarasa Mono K: Available at +# https://github.com/be5invis/Sarasa-Gothic/releases/latest +# 3) Unifont: (easy to install but poor quality) +# Available as distro packages, e.g.: +# Ubuntu/Debian: ttf-unifont +# Fedora: unifont-fonts +# latex_elements['preamble'] +=3D ''' \\IfFontExistsTF{Noto Sans CJK SC}{ % For CJK ascii-art alignment \\setmonofont{Noto Sans Mono CJK SC}[AutoFakeSlant] + \\IfFontExistsTF{D2Coding}{ + \\newCJKfontfamily[KRtruemono]\\krtruemono{D2Coding}[AutoFakeSlant] + \\renewcommand{\\setKRmono}{% + \\renewcommand{\\CJKttdefault}{KRtruemono}} + }{ + \\IfFontExistsTF{Sarasa Mono K}{ + \\newCJKfontfamily[KRtruemono]\\krtruemono{Sarasa Mono K} + \\renewcommand{\\setKRmono}{% + \\renewcommand{\\CJKttdefault}{KRtruemono}} + }{ + \\IfFontExistsTF{Unifont}{ + \\newCJKfontfamily[KRtruemono]\\krtruemono{Unifont}[AutoFakeSlant= ,AutoFakeBold] + \\renewcommand{\\setKRmono}{% + \\renewcommand{\\CJKttdefault}{KRtruemono}} + }{} + } + } }{} ''' --=20 2.17.1