tuningfonts -

Make all internal sections of tuning-fontconfig Sect2 so that the
titles are all in the same font size.
This commit is contained in:
Ken Moffat 2023-11-29 09:21:59 +00:00
parent 3a579120b5
commit 9c1319c602

View File

@ -701,41 +701,45 @@ EOF</userinput></screen>
there a number of different ways of achieving this. there a number of different ways of achieving this.
</para> </para>
<bridgehead renderas="sect3" id="fontconfig-user-docs" </sect2>
xreflabel="Fontconfig user documentation">Fontconfig user documentation</bridgehead>
<para> <sect2 role="configuration" id="fontconfig-user-docs" xreflabel="Fontconfig user documentation">
<application>Fontconfig</application> installs user documentation that <title>Fontconfig user documentation</title>
includes an example 'User configuration file' which among other things
prefers <xref linkend="wenquanyi-zenhei"/> (a Sans font) if a
<emphasis>Serif</emphasis> font is requested for Chinese (this part
might be anachronistic unless you have non-free Chinese fonts, because
in <filename>65-nonlatin.conf</filename> this font is already among the
preferred fonts when Serif is specified for Chinese) and to prefer the
modern <xref linkend="VLGothic"/> font if a Sans font is specified on a
Japanese page (otherwise a couple of other fonts would be preferred if
they have been installed).
</para>
<para> <para>
If you have installed the current version, the user documentation is <application>Fontconfig</application> installs user documentation that
available in HTML, PDF, and text versions at <filename includes an example 'User configuration file' which among other things
class="directory">/usr/share/doc/fontconfig-&fontconfig-version;/</filename> prefers <xref linkend="wenquanyi-zenhei"/> (a Sans font) if a
: change the version if you installed a different one. <emphasis>Serif</emphasis> font is requested for Chinese (this part
</para> might be anachronistic unless you have non-free Chinese fonts, because
in <filename>65-nonlatin.conf</filename> this font is already among the
preferred fonts when Serif is specified for Chinese) and to prefer the
modern <xref linkend="VLGothic"/> font if a Sans font is specified on a
Japanese page (otherwise a couple of other fonts would be preferred if
they have been installed).
</para>
<bridgehead renderas="sect3" id="prefer-a-specific-font" <para>
xreflabel="Prefer a specific font">Prefer a specific font</bridgehead> If you have installed the current version, the user documentation is
available in HTML, PDF, and text versions at <filename
class="directory">/usr/share/doc/fontconfig-&fontconfig-version;/</filename>
: change the version if you installed a different one.
</para>
<para> </sect2>
As an example, if for some reason you wished to use the <ulink
url="https://www.fontsquirrel.com/fonts/nimbus-roman-no9-l">Nimbus Roman <sect2 role="configuration" id="prefer-a-specific-font" xreflabel="Prefer a specific font">
No9 L</ulink> font wherever Times New Roman is referenced (it is <title>Prefer a specific font</title>
metrically similar, and preferred for Times Roman, but the Serif font
from <xref linkend="liberation-fonts"/> will be preferred for the Times <para>
<emphasis>New</emphasis> Roman font if installed), as an individual user As an example, if for some reason you wished to use the <ulink
you could install the font and then create the following file: url="https://www.fontsquirrel.com/fonts/nimbus-roman-no9-l">Nimbus Roman
</para> No9 L</ulink> font wherever Times New Roman is referenced (it is
metrically similar, and preferred for Times Roman, but the Serif font
from <xref linkend="liberation-fonts"/> will be preferred for the Times
<emphasis>New</emphasis> Roman font if installed), as an individual user
you could install the font and then create the following file:
</para>
<screen><userinput>mkdir -pv ~/.config/fontconfig/conf.d &amp;&amp; <screen><userinput>mkdir -pv ~/.config/fontconfig/conf.d &amp;&amp;
cat > ~/.config/fontconfig/conf.d/35-prefer-nimbus-for-timesnew.conf &lt;&lt; "EOF" cat > ~/.config/fontconfig/conf.d/35-prefer-nimbus-for-timesnew.conf &lt;&lt; "EOF"
@ -754,73 +758,75 @@ cat > ~/.config/fontconfig/conf.d/35-prefer-nimbus-for-timesnew.conf &lt;&lt; "
&lt;/fontconfig&gt;</literal> &lt;/fontconfig&gt;</literal>
EOF</userinput></screen> EOF</userinput></screen>
<para> <para>
This is something you would normally do in an individual user's This is something you would normally do in an individual user's
settings, but the file in this case has been prefixed '35-' so that it settings, but the file in this case has been prefixed '35-' so that it
could, if desired, be used system-wide in <filename could, if desired, be used system-wide in <filename
class="directory">/etc/fonts/conf.d/</filename>. class="directory">/etc/fonts/conf.d/</filename>.
</para> </para>
<bridgehead renderas="sect3" id="prefer-chosen-CJK-fonts" </sect2>
xreflabel="Prefer chosen CJK fonts">Prefer chosen CJK fonts</bridgehead>
<para> <sect2 role="configuration" id="prefer-chosen-CJK-fonts" xreflabel="Preferring chosen CJK fonts">
The following example of a local configuration (i.e. one that applies <title>Prefer chosen CJK fonts</title>
for all users of the machine) does several things. It is particularly
appropriate where no language is specified, or for reading CJK text
in a non-CJK locale, and where the Japanese forms of the codepoints
shared with Chinese are preferred. In particular, alternative
approaches would be to specify a Chinese font ahead of the Japanese
font, meaning that only Kana symbols will be used from the Japanese
font, or to not specify DejaVu so that the first font in each set
of preferences is preferred for text using Latin alphabets.
</para>
<orderedlist> <para>
<listitem> The following example of a local configuration (i.e. one that applies
<para> for all users of the machine) does several things. It is particularly
If a Serif font is specified, it prefers <xref linkend="dejavu-fonts"/>. appropriate where no language is specified, or for reading CJK text
If Han codepoints are found, or the Japanese language is specified, in a non-CJK locale, and where the Japanese forms of the codepoints
the Mincho font from <xref linkend="IPAex"/> will be used. If Hangul shared with Chinese are preferred. In particular, alternative
codepoints are found or the Korean language is specified, UnBatang approaches would be to specify a Chinese font ahead of the Japanese
(see <xref linkend="Korean-fonts"/>) will be used: Change that line font, meaning that only Kana symbols will be used from the Japanese
If you installed a different Korean serif font. After that, font, or to not specify DejaVu so that the first font in each set
<xref linkend="wenquanyi-zenhei"/> (Sans, but a default for Serif of preferences is preferred for text using Latin alphabets.
and monospace) is used. A previous version of this page mentioned </para>
using UMing which is a Traditional Chinese font that ships
with an old conf file preferring it for zh-tw and zh-hk language
codes (and for sans-serif and monospace). But without the conf file,
<application>Fontconfig</application> will only treat it as suitable
for zh-hk.
The conf file needs to be edited to current style and will then be
prepended, so specifying UMing does not belong in this
<filename>local.conf</filename> file.
</para>
</listitem>
<listitem>
<para>
For Sans Serif preferences again start with <xref linkend="dejavu-fonts"/>,
then <xref linkend="VLGothic"/> for Japanese before falling back to
WenQuanYi Zen Hei which is Sans and covers both Chinese and Korean
Hangul.
</para>
</listitem>
<listitem>
<para>
The Monospace fonts are forced to the preferred Sans fonts. If the
text is in Chinese or Korean then <xref
linkend="wenquanyi-zenhei"/> will be used.
</para>
</listitem>
</orderedlist>
<para> <orderedlist>
In a non-CJK locale, the result is that suitable fonts will be used for <listitem>
all variants of Chinese, Japanese and Hangul Korean (but Japanese variants <para>
of the glyphs shared with Chinese Han will be used). All other languages If a Serif font is specified, it prefers <xref linkend="dejavu-fonts"/>.
should already work if a font is present. As the <systemitem If Han codepoints are found, or the Japanese language is specified,
class="username">root</systemitem> user: the Mincho font from <xref linkend="IPAex"/> will be used. If Hangul
</para> codepoints are found or the Korean language is specified, UnBatang
(see <xref linkend="Korean-fonts"/>) will be used: Change that line
If you installed a different Korean serif font. After that,
<xref linkend="wenquanyi-zenhei"/> (Sans, but a default for Serif
and monospace) is used. A previous version of this page mentioned
using UMing which is a Traditional Chinese font that ships
with an old conf file preferring it for zh-tw and zh-hk language
codes (and for sans-serif and monospace). But without the conf file,
<application>Fontconfig</application> will only treat it as suitable
for zh-hk.
The conf file needs to be edited to current style and will then be
prepended, so specifying UMing does not belong in this
<filename>local.conf</filename> file.
</para>
</listitem>
<listitem>
<para>
For Sans Serif preferences again start with <xref linkend="dejavu-fonts"/>,
then <xref linkend="VLGothic"/> for Japanese before falling back to
WenQuanYi Zen Hei which is Sans and covers both Chinese and Korean
Hangul.
</para>
</listitem>
<listitem>
<para>
The Monospace fonts are forced to the preferred Sans fonts. If the
text is in Chinese or Korean then <xref
linkend="wenquanyi-zenhei"/> will be used.
</para>
</listitem>
</orderedlist>
<para>
In a non-CJK locale, the result is that suitable fonts will be used for
all variants of Chinese, Japanese and Hangul Korean (but Japanese variants
of the glyphs shared with Chinese Han will be used). All other languages
should already work if a font is present. As the <systemitem
class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>cat > /etc/fonts/local.conf &lt;&lt; "EOF" <screen role="root"><userinput>cat > /etc/fonts/local.conf &lt;&lt; "EOF"
<literal>&lt;?xml version='1.0'?&gt; <literal>&lt;?xml version='1.0'?&gt;
@ -857,7 +863,6 @@ EOF</userinput></screen>
</sect2> </sect2>
<sect2 role="configuration" id="editing-old-style-conf-files" <sect2 role="configuration" id="editing-old-style-conf-files"
xreflabel="Editing Old-Style conf files"> xreflabel="Editing Old-Style conf files">
<title>Editing Old-Style conf files</title> <title>Editing Old-Style conf files</title>
@ -950,8 +955,10 @@ EOF</userinput></screen>
&lt;/match&gt;</literallayout> &lt;/match&gt;</literallayout>
</para> </para>
<bridgehead renderas="sect3" id="font-weights" </sect2>
xreflabel="About font weights">About font weights</bridgehead>
<sect2 role="configuration" id="font-weights" xreflabel="About font weights">
<title>About font weights</title>
<para> <para>
When this page and the next page were first created, Latin fonts came When this page and the next page were first created, Latin fonts came
@ -1020,8 +1027,10 @@ EOF</userinput></screen>
adequate : ken --> adequate : ken -->
</para> </para>
<bridgehead renderas="sect3" id="items-which-can-override-fontconfig" </sect2>
xreflabel="Items which can override fontconfig">Items which can override Fontconfig</bridgehead>
<sect2 role="configuration" id="items-which-can-override-fontconfig" xreflabel="Items which can override Fontconfig">
<title>Items which can override Fontconfig</title>
<para> <para>
Several desktop environments, as well as some programs, will use Several desktop environments, as well as some programs, will use