Changeset 9c1319c
- Timestamp:
- 11/29/2023 09:21:59 AM (6 months ago)
- Branches:
- 12.1, ken/TL2024, ken/tuningfonts, lazarus, plabs/newcss, python3.11, rahul/power-profiles-daemon, trunk, xry111/llvm18
- Children:
- 0262f7c
- Parents:
- 3a579120
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
x/installing/tuning-fontconfig.xml
r3a579120 r9c1319c 702 702 </para> 703 703 704 <bridgehead renderas="sect3" id="fontconfig-user-docs" 705 xreflabel="Fontconfig user documentation">Fontconfig user documentation</bridgehead> 706 707 <para> 708 <application>Fontconfig</application> installs user documentation that 709 includes an example 'User configuration file' which among other things 710 prefers <xref linkend="wenquanyi-zenhei"/> (a Sans font) if a 711 <emphasis>Serif</emphasis> font is requested for Chinese (this part 712 might be anachronistic unless you have non-free Chinese fonts, because 713 in <filename>65-nonlatin.conf</filename> this font is already among the 714 preferred fonts when Serif is specified for Chinese) and to prefer the 715 modern <xref linkend="VLGothic"/> font if a Sans font is specified on a 716 Japanese page (otherwise a couple of other fonts would be preferred if 717 they have been installed). 718 </para> 719 720 <para> 721 If you have installed the current version, the user documentation is 722 available in HTML, PDF, and text versions at <filename 723 class="directory">/usr/share/doc/fontconfig-&fontconfig-version;/</filename> 724 : change the version if you installed a different one. 725 </para> 726 727 <bridgehead renderas="sect3" id="prefer-a-specific-font" 728 xreflabel="Prefer a specific font">Prefer a specific font</bridgehead> 729 730 <para> 731 As an example, if for some reason you wished to use the <ulink 732 url="https://www.fontsquirrel.com/fonts/nimbus-roman-no9-l">Nimbus Roman 733 No9 L</ulink> font wherever Times New Roman is referenced (it is 734 metrically similar, and preferred for Times Roman, but the Serif font 735 from <xref linkend="liberation-fonts"/> will be preferred for the Times 736 <emphasis>New</emphasis> Roman font if installed), as an individual user 737 you could install the font and then create the following file: 738 </para> 704 </sect2> 705 706 <sect2 role="configuration" id="fontconfig-user-docs" xreflabel="Fontconfig user documentation"> 707 <title>Fontconfig user documentation</title> 708 709 <para> 710 <application>Fontconfig</application> installs user documentation that 711 includes an example 'User configuration file' which among other things 712 prefers <xref linkend="wenquanyi-zenhei"/> (a Sans font) if a 713 <emphasis>Serif</emphasis> font is requested for Chinese (this part 714 might be anachronistic unless you have non-free Chinese fonts, because 715 in <filename>65-nonlatin.conf</filename> this font is already among the 716 preferred fonts when Serif is specified for Chinese) and to prefer the 717 modern <xref linkend="VLGothic"/> font if a Sans font is specified on a 718 Japanese page (otherwise a couple of other fonts would be preferred if 719 they have been installed). 720 </para> 721 722 <para> 723 If you have installed the current version, the user documentation is 724 available in HTML, PDF, and text versions at <filename 725 class="directory">/usr/share/doc/fontconfig-&fontconfig-version;/</filename> 726 : change the version if you installed a different one. 727 </para> 728 729 </sect2> 730 731 <sect2 role="configuration" id="prefer-a-specific-font" xreflabel="Prefer a specific font"> 732 <title>Prefer a specific font</title> 733 734 <para> 735 As an example, if for some reason you wished to use the <ulink 736 url="https://www.fontsquirrel.com/fonts/nimbus-roman-no9-l">Nimbus Roman 737 No9 L</ulink> font wherever Times New Roman is referenced (it is 738 metrically similar, and preferred for Times Roman, but the Serif font 739 from <xref linkend="liberation-fonts"/> will be preferred for the Times 740 <emphasis>New</emphasis> Roman font if installed), as an individual user 741 you could install the font and then create the following file: 742 </para> 739 743 740 744 <screen><userinput>mkdir -pv ~/.config/fontconfig/conf.d && … … 755 759 EOF</userinput></screen> 756 760 757 <para> 758 This is something you would normally do in an individual user's 759 settings, but the file in this case has been prefixed '35-' so that it 760 could, if desired, be used system-wide in <filename 761 class="directory">/etc/fonts/conf.d/</filename>. 762 </para> 763 764 <bridgehead renderas="sect3" id="prefer-chosen-CJK-fonts" 765 xreflabel="Prefer chosen CJK fonts">Prefer chosen CJK fonts</bridgehead> 766 767 <para> 768 The following example of a local configuration (i.e. one that applies 769 for all users of the machine) does several things. It is particularly 770 appropriate where no language is specified, or for reading CJK text 771 in a non-CJK locale, and where the Japanese forms of the codepoints 772 shared with Chinese are preferred. In particular, alternative 773 approaches would be to specify a Chinese font ahead of the Japanese 774 font, meaning that only Kana symbols will be used from the Japanese 775 font, or to not specify DejaVu so that the first font in each set 776 of preferences is preferred for text using Latin alphabets. 777 </para> 778 779 <orderedlist> 780 <listitem> 781 <para> 782 If a Serif font is specified, it prefers <xref linkend="dejavu-fonts"/>. 783 If Han codepoints are found, or the Japanese language is specified, 784 the Mincho font from <xref linkend="IPAex"/> will be used. If Hangul 785 codepoints are found or the Korean language is specified, UnBatang 786 (see <xref linkend="Korean-fonts"/>) will be used: Change that line 787 If you installed a different Korean serif font. After that, 788 <xref linkend="wenquanyi-zenhei"/> (Sans, but a default for Serif 789 and monospace) is used. A previous version of this page mentioned 790 using UMing which is a Traditional Chinese font that ships 791 with an old conf file preferring it for zh-tw and zh-hk language 792 codes (and for sans-serif and monospace). But without the conf file, 793 <application>Fontconfig</application> will only treat it as suitable 794 for zh-hk. 795 The conf file needs to be edited to current style and will then be 796 prepended, so specifying UMing does not belong in this 797 <filename>local.conf</filename> file. 798 </para> 799 </listitem> 800 <listitem> 801 <para> 802 For Sans Serif preferences again start with <xref linkend="dejavu-fonts"/>, 803 then <xref linkend="VLGothic"/> for Japanese before falling back to 804 WenQuanYi Zen Hei which is Sans and covers both Chinese and Korean 805 Hangul. 806 </para> 807 </listitem> 808 <listitem> 809 <para> 810 The Monospace fonts are forced to the preferred Sans fonts. If the 811 text is in Chinese or Korean then <xref 812 linkend="wenquanyi-zenhei"/> will be used. 813 </para> 814 </listitem> 815 </orderedlist> 816 817 <para> 818 In a non-CJK locale, the result is that suitable fonts will be used for 819 all variants of Chinese, Japanese and Hangul Korean (but Japanese variants 820 of the glyphs shared with Chinese Han will be used). All other languages 821 should already work if a font is present. As the <systemitem 822 class="username">root</systemitem> user: 823 </para> 761 <para> 762 This is something you would normally do in an individual user's 763 settings, but the file in this case has been prefixed '35-' so that it 764 could, if desired, be used system-wide in <filename 765 class="directory">/etc/fonts/conf.d/</filename>. 766 </para> 767 768 </sect2> 769 770 <sect2 role="configuration" id="prefer-chosen-CJK-fonts" xreflabel="Preferring chosen CJK fonts"> 771 <title>Prefer chosen CJK fonts</title> 772 773 <para> 774 The following example of a local configuration (i.e. one that applies 775 for all users of the machine) does several things. It is particularly 776 appropriate where no language is specified, or for reading CJK text 777 in a non-CJK locale, and where the Japanese forms of the codepoints 778 shared with Chinese are preferred. In particular, alternative 779 approaches would be to specify a Chinese font ahead of the Japanese 780 font, meaning that only Kana symbols will be used from the Japanese 781 font, or to not specify DejaVu so that the first font in each set 782 of preferences is preferred for text using Latin alphabets. 783 </para> 784 785 <orderedlist> 786 <listitem> 787 <para> 788 If a Serif font is specified, it prefers <xref linkend="dejavu-fonts"/>. 789 If Han codepoints are found, or the Japanese language is specified, 790 the Mincho font from <xref linkend="IPAex"/> will be used. If Hangul 791 codepoints are found or the Korean language is specified, UnBatang 792 (see <xref linkend="Korean-fonts"/>) will be used: Change that line 793 If you installed a different Korean serif font. After that, 794 <xref linkend="wenquanyi-zenhei"/> (Sans, but a default for Serif 795 and monospace) is used. A previous version of this page mentioned 796 using UMing which is a Traditional Chinese font that ships 797 with an old conf file preferring it for zh-tw and zh-hk language 798 codes (and for sans-serif and monospace). But without the conf file, 799 <application>Fontconfig</application> will only treat it as suitable 800 for zh-hk. 801 The conf file needs to be edited to current style and will then be 802 prepended, so specifying UMing does not belong in this 803 <filename>local.conf</filename> file. 804 </para> 805 </listitem> 806 <listitem> 807 <para> 808 For Sans Serif preferences again start with <xref linkend="dejavu-fonts"/>, 809 then <xref linkend="VLGothic"/> for Japanese before falling back to 810 WenQuanYi Zen Hei which is Sans and covers both Chinese and Korean 811 Hangul. 812 </para> 813 </listitem> 814 <listitem> 815 <para> 816 The Monospace fonts are forced to the preferred Sans fonts. If the 817 text is in Chinese or Korean then <xref 818 linkend="wenquanyi-zenhei"/> will be used. 819 </para> 820 </listitem> 821 </orderedlist> 822 823 <para> 824 In a non-CJK locale, the result is that suitable fonts will be used for 825 all variants of Chinese, Japanese and Hangul Korean (but Japanese variants 826 of the glyphs shared with Chinese Han will be used). All other languages 827 should already work if a font is present. As the <systemitem 828 class="username">root</systemitem> user: 829 </para> 824 830 825 831 <screen role="root"><userinput>cat > /etc/fonts/local.conf << "EOF" … … 858 864 </sect2> 859 865 860 861 866 <sect2 role="configuration" id="editing-old-style-conf-files" 862 867 xreflabel="Editing Old-Style conf files"> … … 951 956 </para> 952 957 953 <bridgehead renderas="sect3" id="font-weights" 954 xreflabel="About font weights">About font weights</bridgehead> 958 </sect2> 959 960 <sect2 role="configuration" id="font-weights" xreflabel="About font weights"> 961 <title>About font weights</title> 955 962 956 963 <para> … … 1021 1028 </para> 1022 1029 1023 <bridgehead renderas="sect3" id="items-which-can-override-fontconfig" 1024 xreflabel="Items which can override fontconfig">Items which can override Fontconfig</bridgehead> 1030 </sect2> 1031 1032 <sect2 role="configuration" id="items-which-can-override-fontconfig" xreflabel="Items which can override Fontconfig"> 1033 <title>Items which can override Fontconfig</title> 1025 1034 1026 1035 <para>
Note:
See TracChangeset
for help on using the changeset viewer.