Changes in / [1b9bf3e:3a579120]


Ignore:
Location:
x/installing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • x/installing/TTF-and-OTF-fonts.xml

    r1b9bf3e r3a579120  
    2727      Type1 fonts were added, but the desktop world moved on to using TrueType
    2828      and Open Type fonts. To support these, Xorg uses Xft, the X FreeType
    29       interface library.
    30     </para>
    31 
    32     <para>
    33       These fonts can provide hints, which <application>fontconfig</application>
    34       uses to adjust them for maximum readability on computer monitors. On Linux
    35       you should always use the hinted versions if they are available (in
    36       general the Latin, Cyrillic and Greek alphabets can use hints, most other
    37       writing systems do not use hinting).
     29      interface library, with <application>Fontconfig</application> (see
     30      previous page for details including how fonts are selected and various
     31      reasons why a font might be ignored).
    3832    </para>
    3933
     
    142136      In the past, everybody recommended running <command>fc-cache</command>
    143137      as the &root; user after installing or removing fonts, but this is not
    144       necessary anymore on Linux, <application>fontconfig</application> will do
     138      necessary anymore on Linux, <application>Fontconfig</application> will do
    145139      it automatically if needed as well as if the font caches are more than 30
    146140      seconds old. However, if you add a font and want to use it immediately,
     
    187181
    188182    <para>
     183      The list below will not provide complete Unicode coverage.
     184      Unicode is updated every year, and most additions are now for historic
     185      writing systems. For almost-complete coverage you can install the
     186      full set of <xref linkend="noto-fonts"/> (there are separate fonts for
     187      different writing systems). We used to recommend the <ulink
     188      url="https://unifont.org/fontguide/">Unicode Font Guide</ulink>, but that
     189      has not been updated since 2008 and many of its links are dead.
     190    </para>
     191
     192    <para>
    189193      Rendered examples of most of these fonts, and many others, with
    190       details of what languages they cover, some examples of latin fonts with
    191       the same metrics (listed as "Substitute latin fonts") and various files
    192       of dummy text to compare fonts of similar types, can be found at this
    193       <ulink url="http://zarniwhoop.uk/ttf-otf-notes.html#examples">
    194       font comparison</ulink> page. That site also covers other current
    195       writing systems.
     194      details of what languages they cover, can be found at a
     195      <ulink url="http://zarniwhoop.uk/ttf-otf-notes.html">font-comparison</ulink>
     196      website.
    196197    </para>
    197198
     
    251252    </note>
    252253
    253     <!-- fonts covering at least latin languages, order alphabetically
     254    <!-- fonts covering at least Latin languages, order alphabetically
    254255    NB the xreflabel in the bridgehead is used in any link names, the
    255256    associated text is embiggened for the heading, the text for the
     
    309310      characters, as well as Cyrillic, Greek, Arabic, Hebrew, Armenian,
    310311      Georgian and some other glyphs. In the absence of the Bitstream Vera
    311       fonts (which had much less coverage), these are the default fallback
    312       fonts.
     312      fonts (which had much less coverage), these were the default fallback
     313      fonts for 'Latin' languages. As of Fontconfig-2.14, if the Noto 'Latin'
     314      fonts have been installed they will be prioritised ahead of DejaVu.
    313315    </para>
    314316
     
    318320    <para>
    319321      <ulink url="https://ftpmirror.gnu.org/gnu/freefont/">GNU FreeFont</ulink>
    320       &ndash; This set of fonts covers many non-CJK characters, in
    321       particular some of the variants of Latin and Cyrillic letters used in
    322       minority languages, but the glyphs are comparatively small (unlike DejaVu
    323       fonts which are comparatively large) and rather light weight ("less black"
    324       when black on white is used) which means that in some contexts such as
    325       terminals they are not visually pleasing, for example when most other
    326       glyphs are provided by another font. On the other hand, some fonts used
    327       primarily for printed output, and many CJK fonts, are also light weight.
     322      &ndash; This set of fonts covers many non-CJK characters, but the glyphs
     323      are comparatively small (unlike Noto and DejaVu fonts which are
     324      comparatively large) and rather light weight ("less black" when black on
     325      white is used) which means that in some contexts such as terminals they
     326      are not visually pleasing, for example when most other glyphs are provided
     327      by another font. On the other hand, some fonts used primarily for printed
     328      output, and many CJK fonts, are also light weight.
    328329    </para>
    329330
     
    334335      <ulink url="https://fontlibrary.org/en/font/gelasio">Gelasio</ulink> is
    335336      metrically compatible with MS Georgia and
    336       <application>fontconfig</application> will use it if MS Georgia is
     337      <application>Fontconfig</application> will use it if MS Georgia is
    337338      requested but is not installed.
    338339    </para>
     
    386387    <para>
    387388      Although many old posts recommend installing these fonts for
    388       output which looks better, there are more recent posts that these are
    389       'ugly' or 'broken'. One suggestion is that they do not support anti-aliasing.
     389      output which looks better, less old posts say that these are
     390      'ugly' or 'broken' with modern <application>Fontconfig</application>,
     391      <application>Freetype</application> and <application>Pango.</application>
     392      Most people will not want to install any of these fonts.
    390393    </para>
    391394
     
    409412      avoiding boxes with dots [hex digits] when a glyph cannot be found) are a
    410413      set of fonts which aim to cover <emphasis>every glyph in Unicode, no
    411       matter how obscure</emphasis>. Noto Sans is the preferred font for KDE
    412       Plasma and applications, except for monospace fonts where <ulink
    413       url="https://github.com/source-foundry/Hack">Hack</ulink> is preferred.
     414      matter how obscure</emphasis>.
    414415    </para>
    415416
    416417    <para>
    417418      People using languages written in Latin, Greek or Cyrillic alphabets only
    418       need to install Noto Sans itself, and perhaps Noto Sans Symbols for
    419       currency symbols. For more details on the organization of Noto fonts see <ulink
     419      need to install Noto Sans, Noto Serif and/or Noto Sans Mono.
     420      For more details on the organization of Noto fonts see <ulink
    420421      url="https://fonts.google.com/noto/use#how-are-noto-fonts-organized/">how
    421422      are noto fonts organized</ulink>. There are also separate fonts for every
    422       other current writing system, but these will also require Noto Sans
    423       (or Noto Serif) and perhaps Noto Symbols.
     423      other current writing system, but those do not cover text in Latin
     424      languages.
     425    </para>
     426
     427    <para>
     428      Those three fonts are the first-choice preferences of
     429      <application>Fontconfig</application> for text
     430      in those three alphabets, and they are updated frequently to cover recent
     431      Unicode additions such as the extensions for phonetic transcription in
     432      Latin and Cyrillic alphabets.
    424433    </para>
    425434
     
    433442
    434443    <para>
    435       However, you should be aware that <application>fontconfig</application>
    436       knows nothing about Noto fonts. The 'Noto Sans Something' fonts are each
    437       treated as separate fonts (and for Arabic there is not a specific Sans
    438       name), so if you have other fonts installed then the choice of which font
    439       to use for missing glyphs where 'Noto Sans' is specified will be random,
    440       except that Sans fonts will be preferred over <emphasis>known</emphasis>
    441       Serif and Monospace fonts because Sans is the fallback for unknown fonts.
     444      For the Noto CJK fonts it is easier to find the specific zip archive
     445      you desire at Github. Go to <ulink
     446      url="https://github.com/notofonts/noto-cjk/releases/"></ulink> and
     447      look for the newest Sans or Serif version with its own updated Download
     448      guide and its assets. The Download guides should help you to identify
     449      which zip file best matches your requirements.
     450    </para>
     451
     452    <para>
     453      Noto Sans is the preferred font for KDE Plasma and applications, except
     454      for monospace fonts where <ulink
     455      url="https://github.com/source-foundry/Hack">Hack</ulink> is preferred.
     456    </para>
     457
     458    <para>
     459      For writing systems not using the Latin, Greek or Cyrillic alphabets the
     460      Noto fonts are not preferred by <application>Fontconfig</application>.
     461      If you use a Noto font for
     462      a modern language where another installed font also covers it (e.g. the
     463      DejaVu conts cover several Right-to-Left alphabets), you might need to
     464      set a preference for <application>Fontconfig</application> - see the
     465      previous page.
    442466    </para>
    443467
     
    487511    </para>
    488512
     513    <bridgehead renderas="sect3" id="lohit-fonts"
     514    xreflabel="Lohit fonts">Lohit fonts</bridgehead>
     515
     516    <indexterm zone="TTF-and-OTF-fonts lohit-fonts">
     517      <primary sortas="a-lohit-fonts">Lohit fonts</primary>
     518    </indexterm>
     519
     520    <para>
     521      For Indic languages, <application>Fontconfig</application> now prefers
     522      Lohit fonts (Sanskrit for 'red'). They can be found at <ulink url=
     523      "https://releases.pagure.org/lohit/">pagure.org</ulink>         
     524    </para>
     525
    489526    <bridgehead renderas="sect3" id="CJKfonts"
    490527    xreflabel="CJKfonts">CJK fonts:</bridgehead>
     
    499536
    500537    <para>
    501       Also, <application>fontconfig</application> prefers Chinese to Japanese
     538      Also, <application>Fontconfig</application> prefers Chinese to Japanese
    502539      by default. Tuning that is covered at <xref linkend="prefer-chosen-CJK-fonts"/>.
    503540    </para>
     
    519556      written in Mandarin. The UMing HK, Noto Sans HK and WenQuanYi Zen Hei
    520557      fonts all seem to cover Hong Kong usage
    521       (<application>fontconfig</application> disagrees about Noto Sans HK).
     558      (<application>Fontconfig</application> disagrees about Noto Sans HK).
    522559    </para>
    523560
     
    671708      Zen Hei</ulink> provides a Sans-Serif font which covers all CJK scripts
    672709      including Korean. Although it includes old-style conf files, these are
    673       not required: <application>fontconfig</application> will already treat
     710      not required: <application>Fontconfig</application> will already treat
    674711      these fonts (the 'sharp' contains bitmaps, the monospace appears not
    675712      to be Mono in its ASCII part) as Sans, Serif, and Monospace. If all
     
    708745      <ulink url='https://moji-or-jp.translate.goog/ipafont/?_x_tr_sl=auto&amp;_x_tr_tl=en&amp;_x_tr_hl=en&amp;_x_tr_pto=wapp'>Google Translate</ulink>
    709746      on the home page, then click on the download link for IPAex Font Ver.004.01.
    710       Unfortunately, <application>fontconfig</application> only knows about
     747      Unfortunately, <application>Fontconfig</application> only knows about
    711748      the older IPAfonts and the forked IPA Mona font (which is not easily
    712749      available and which apparently does not meet Debian's Free Software
    713750      guidelines). If you install the IPAex fonts, you may want to make it known
    714       to fontconfig. Please see <xref
     751      to <application>Fontconfig</application>. Please see <xref
    715752      linkend="prefer-chosen-CJK-fonts"/> for one way to accomplish this.
    716753    </para>
     
    745782      Gothic are the main Sans fonts. BLFS previously recommended the
    746783      Baekmuk fonts, but the Nanum and Un fonts are now preferred to Baekmuk by
    747       <application>fontconfig</application> because of user requests.
     784      <application>Fontconfig</application> because of user requests.
    748785    </para>
    749786
  • x/installing/tuning-fontconfig.xml

    r1b9bf3e r3a579120  
    2626      If you only read text in English, and are happy with the common libre
    2727      fonts listed on the next page, you may never need to worry about the
    28       details of how <application>fontconfig</application> works. But there are
     28      details of how <application>Fontconfig</application> works. But there are
    2929      many things which can be altered if they do not suit your needs.
    3030    </para>
     
    3535      that some things have changed over the years, for example the autohinter
    3636      is no longer the default). The aim here is to give you enough information
    37       to understand the changes you are making.
    38     </para>
     37      to understand the changes you are making, why they may not always work,
     38      and to identify online information which is no-longer appropriate.
     39    </para>
     40
     41    <para>
     42      Unfortunately, some of the terminology is ambiguous (e.g. 'font face' can
     43      mean a name known to Fontconfig, <emphasis>or</emphasis> the ordinary,
     44      condensed, etc variations of a font) and 'style' can be used to
     45      differentiate 'ordinary' from 'italic', or in describing some classes of
     46      Serif fonts.
     47    </para>
     48
     49    <para>The following links are to assist navigation in this page.</para>
     50    <itemizedlist>
     51      <listitem>
     52        <para><xref linkend="xft-font-protocol"/></para>
     53      </listitem>
     54      <listitem>
     55        <para><xref linkend="useful-commands"/></para>
     56      </listitem>
     57      <listitem>
     58        <para><xref linkend="the-various-files"/></para>
     59      </listitem>
     60      <listitem>
     61        <para><xref linkend="rules-to-choose-a-font"/></para>
     62      </listitem>
     63      <listitem>
     64        <para><xref linkend="hinting-and-antialiasing"/></para>
     65      </listitem>
     66      <listitem>
     67        <para><xref linkend="disabling-bitmap-fonts"/></para>
     68      </listitem>
     69      <listitem>
     70        <para><xref linkend="synthetic-changes"/></para>
     71      </listitem>
     72      <listitem>
     73        <para><xref linkend="adding-extra-directories"/></para>
     74      </listitem>
     75      <listitem>
     76        <para><xref linkend="preferring-certain-fonts"/></para>
     77      </listitem>
     78      <listitem>
     79        <para><xref linkend="fontconfig-user-docs"/></para>
     80      </listitem>
     81      <listitem>
     82        <para><xref linkend="prefer-a-specific-font"/></para>
     83      </listitem>
     84      <listitem>
     85        <para><xref linkend="prefer-chosen-CJK-fonts"/></para>
     86      </listitem>
     87      <listitem>
     88        <para><xref linkend="editing-old-style-conf-files"/></para>
     89      </listitem>
     90      <listitem>
     91        <para><xref linkend="font-weights"/></para>
     92      </listitem>
     93      <listitem>
     94        <para><xref linkend="items-which-can-override-fontconfig"/></para>
     95      </listitem>
     96      <listitem>
     97        <para><xref linkend="external-links"/></para>
     98      </listitem>
     99    </itemizedlist>
    39100
    40101    </sect2>
     
    46107      The Xft font protocol provides antialiased font rendering through
    47108      <application>freetype</application>, and fonts are controlled from the
    48       client side using <application>fontconfig</application> (except for
     109      client side using <application>Fontconfig</application> (except for
    49110      <xref linkend="rxvt-unicode"/> which can use fonts listed in
    50111      <filename>~/.Xresources</filename>, and <xref linkend="abiword"/> which
     
    90151
    91152    <para>
    92       The following commands may be helpful when working with fontconfig:
     153      The following commands may be helpful when working with
     154      <application>Fontconfig</application>,
     155      particularly if you are interested in overriding which font will be
     156      chosen. 'TYPE' should be one of serif, sans-serif or monospace.
    93157    </para>
    94158
     
    105169      see what happens if a font you have not installed is requested, but you
    106170      can also use it if the system is giving you a different font from
    107       what you expected (perhaps because <application>fontconfig</application>
     171      what you expected (perhaps because <application>Fontconfig</application>
    108172      does not think that the font supports your language).
    109173    </para>
    110174
    111175    <para>
    112       <command>fc-match -a 'Type' | less</command> : provides a list of all
    113       fonts which can be used for that type (Monospace, Sans, Serif). Note that
    114       in-extremis <application>fontconfig</application> will take a glyph from
    115       any available font, even if it is not of the specified type, and unless it
    116       knows about the font's type it will assume it is Sans.
     176      <command>fc-match -a <replaceable>Type</replaceable> | less</command> :
     177      provides a list of all fonts which can be used for that type (Monospace,
     178      Sans Sans-serif, Serif <emphasis>(capital letters optional)</emphasis>).
     179      Note that in-extremis <application>Fontconfig</application> will take a
     180      glyph from any available font, even if it is not of the specified type,
     181      and unless it knows about the font's type it will assume it is Sans.
     182    </para>
     183
     184    <para>
     185      <command>fc-match 'Serif :lang=ja:weight=bold'</command> will tell you
     186      which font and weight will be chosen for Japanese text in bold weight.
     187      It does not mean that the reported font will necessarily be able to show
     188      Japanese ideograms, so a fallback might be used, or some glyphs may be
     189      missing. For language codes use  ISO-639 value such as 'fr', 'ja', 'zh-cn'.
     190      Note that an unrecognized value such as just 'zh' will not return any
     191      match. To illustrate the fallback, on a system wherei both Noto Sans Mono
     192      and DejaVu Sans Mono are installed, <command>fc-match 'monospace
     193      :lang=en</command> shows Noto Sans Mono will be used, but if the lang is
     194      changed to 'ar' (arabic) DejaVu Sans will be used.
     195    </para>
     196
     197    <para>
     198      If you want to determine if a font file has hinting (many older fonts do not,
     199      because it was patented) use <command>fc-query
     200      <replaceable>/path/to/fontfile</replaceable> | grep 'fonthashint:'</command>:
     201      which will report 'True(s)' or 'False(s)'.
    117202    </para>
    118203
     
    132217      particularly useful for CJK languages, and you can also pass a
    133218      language, e.g. PANGO_LANGUAGE=en;ja (English, then assume Japanese)
    134       or just zh-cn (or other variants - 'zh' on its own is not valid).
     219      or just zh-cn (or other variants such as zh-sg or zh-tw).
    135220    </para>
    136221
    137222    </sect2>
    138223
    139     <sect2 role="configuration" id="the-various-files" xreflabel="The various files">
    140     <title>The various files</title>
     224    <sect2 role="configuration" id="the-various-files" xreflabel="The configuration files">
     225    <title>The configuration files</title>
    141226
    142227    <para>
     
    224309    </para>
    225310
    226     <note>
    227       <para>
    228         In fontconfig-2.14 the defaults were changed to Noto fonts. Some of the
    229         detail here is out of date and will be revised.
    230       </para>
    231     </note>
    232 
    233311    <para>
    234312      However, if the document or page requested a font which is not installed
     
    236314      following rules come into play: First,
    237315      <filename>30-metric-aliases.conf</filename> is used to map aliases for
    238       some fonts with the same metrics (same size, etc). After that, an
    239       unknown font will be searched for in <filename>45-latin.conf</filename> -
    240       if it is found it will be mapped as Serif or Monospace or Sans, otherwise
    241       it will be assumed to be Sans. Then <filename>50-latin.conf</filename>
    242       provides ordered lists of the fallbacks - <xref linkend="dejavu-fonts"/>
     316      some fonts with the same metrics (same size, etc). Note that there are
     317      both weak and strong aliases so that aliases for one form such as
     318      Helvetica or Times New Roman can be satisfied by the other style, i.e.
     319      anything which is an alias of Arial or Times in those examples. some
     320      examples of Latin fonts with the same metrics can be found in the
     321      'Substitutes' PDFs at <ulink
     322      url="http://zarniwhoop.uk/files/PDF-substitutes/">zarniwhoop.uk.)</ulink>
     323    </para>
     324
     325    <para>
     326      After that, an unknown font will be searched for in
     327      <filename>45-latin.conf</filename>:
     328      'Latin' covers Cyrillic and Greek, and now also maps system-ui fonts which
     329      are used for User Interface messages in other alphabets. If the font
     330      is found it will be mapped as serif, sans-serif, monospace, fantasy,
     331      cursive, or system-ui.  Otherwise, 49-sansserif.conf will assume it is
     332      Sans.
     333    </para>
     334    <para>
     335      Then <filename>60-latin.conf</filename>
     336      provides ordered lists of the fallbacks - <xref linkend="noto-fonts"/>
    243337      will be used if you installed them. Cyrillic and Greek appear to be
    244       treated in the same way. There are similar files with a 65- prefix for
    245       Persian and other non-latin writing systems. All of these files prefer
     338      treated in the same way.All of these files prefer
    246339      commercial fonts if they are present, although modern libre fonts are
    247       often at least equal.
    248     </para>
    249 
    250     <para>
    251       Since fontconfig-2.12.5, there is also generic family matching for some
     340      often at least equal. Finally, if a codepoint is still not found it can
     341      be taken from any available system font. The following details only
     342      mention freely available fonts.
     343    </para>
     344
     345    <para>
     346      Default Persion fonts are dealt with in
     347      <filename>65-fonts-persian.conf</filename>. It looks as if all the listed
     348      fonts are commercial. Using fonts that support Persian (which has its own
     349      variant of the arabic alphabet, and its own font styles) is outside the
     350      skills of the BLFS editors.
     351    </para>
     352
     353    <para>
     354      All remaining scripts for which <application>Fontconfig</application> has
     355      preferences (CJK scripts,
     356      Indic scripts) are dealt with in <filename>65-nonlatin.conf</filename>.
     357      These are again nominally grouped as Serif, Sans-Serif, Monospace. Of the
     358      free fonts, WenQuanYi Zen Hei (Pan-CJK Sans) comes first for both Serif
     359      and for Sans. Therefore, if you install this as a fallback but want to
     360      use different fonts for Japanese or Korean you will need to set up a
     361      preference. Similarly, the old fireflysung Serif font is also listed for
     362      Sans.
     363    </para>
     364
     365    <para>
     366      After Pan-CJK and Chinese fonts come several Japanese fonts and then
     367      several Korean fonts (both split appropriately between Sans and Serif).
     368      Finally come the various Lohit Indic families (one font file per script),
     369      labelled as both Sans and Serif.
     370    </para>
     371
     372    <para>
     373      The Monospace fonts listed in <filename>65-nonlatin.conf</filename> do
     374      not include WenQuanYi Zen Hei although that will be available as a
     375      fallback if installed. Several Japanese Gothic fonts are listed, followed
     376      by AR PL KaitiM GB (a zh-sc 'Brush' font), AR PL Serif fonts for zh-sc
     377      (SungtiL) and zh-tw (Mingti2L), some Korean Sans fonts and the various
     378     Lohit Indic families.
     379    </para>
     380
     381    <para>
     382     For UI fonts, various Noto Sans UI fonts are the only listed free fonts.
     383    </para>
     384
     385    <para>
     386      The various Noto CJK fonts are <emphasis>not</emphasis> among the listed
     387      fonts, possibly the RedHat developers preferred other fonts.  These now
     388      come in many variations, probably anyone who uses these will not install
     389      any other CJK fonts.
     390    </para>
     391
     392    <para>
     393      Before Fontconfig-2.14, the first preferred Latin font family was Bitstream
     394      Vera. In practice that was rarely used because it covered so little. After
     395      that, DejaVu was the next preferred family, so people were recommended to
     396      install that. That has now changed, Bitstream Vera has been replaced by the
     397      relevant Noto fonts (Serif, Sans, Sans Mono), so these will be preferred if
     398      they have been installed, followed by DejaVu.
     399    </para>
     400
     401    <para>
     402      For serif, Times New Roman could have been aliased from Liberation Serif or
     403      Tinos, and Times from TeX Gyre Termes, so although the named fonts are not
     404      free, the metric-compatilbe fonts can be used. Ignoring other non-free fonts,
     405      the remaining order for serif is: Times New Roman, Luxi Serif, Nimbus Roman
     406      No9 L, Times. In practice, that means those fonts at the end of the list
     407      are unlikely to be used unless a web page asks for them.
     408    </para>
     409
     410    <para>
     411      For sans-serif, the remaining order is anything mapped to Arial, Luxi Sans,
     412      Nimbus Sans L, anything mapped to Helvetica.
     413    </para>
     414
     415    <para>
     416      The remaining alternatives for monospace are Inconsolata, anything mapped
     417      to Courier New, Luxi Mono, Nimbus Mono, anything mapped to Courier.
     418    </para>
     419
     420    <para>
     421      For 'fantasy' there are no free fonts, so
     422      <application>Fontconfig</application> will fall back to sans-serif.
     423    </para>
     424
     425    <para>
     426      For 'cursive', the only free font is TeX Gyre Chorus as an alias for
     427      ITC Zapf chancery, otherwise <application>Fontconfig</application> will
     428      again fall back to sans-serif.
     429    </para>
     430
     431    <para>
     432      The system-ui category is unusual. It is for interface messages, so some
     433      scripts need special versions to fit in the available space. For Latin,
     434      Greek and Cyrillic an ordinary sans font should fit without problems. However,
     435      the first preferred font is Cantarell, followed by Noto Sans UI. Cantarell
     436      started as a Latin sans-serif font, that has been forked in Gnome under
     437      the same name but they only provide the source. The Noto Sans UI fonts are
     438      for other languages.
     439    </para>
     440
     441    <para>
     442      Since Fontconfig-2.12.5, there is also generic family matching for some
    252443      emoji and math fonts, please see {45,60}-generic.conf.
    253444    </para>
     
    276467      To try out different settings, you may need to exit from Xorg and then
    277468      run <command>startx</command> again so that all applications use the new
    278       settings. If you use GNOME, KDE, or LXQt, their desktops can override
    279       these changes. To explore the possibilities, create a file for your user:
     469      settings. Several things can override the fontconfig settings, see
     470      <xref linkend="items-which-can-override-fontconfig"/> below. To explore
     471      the possibilities, create a file for your user:
    280472    </para>
    281473
     
    300492    &lt;!-- options for hintstyle:
    301493    hintfull: is supposed to give a crisp font that aligns well to the
    302     character-cell grid but at the cost of its proper shape.
    303 
    304     hintmedium: poorly documented, maybe a synonym for hintfull.
     494    character-cell grid but at the cost of its proper shape. However, anything
     495    using Pango >= 1.44 will not support full hinting, Pango now uses harfbuzz
     496    for hinting. Apps which use Skia (e.g. Chromium, Firefox) should not be
     497    affected by this. <!-- https://github.com/harfbuzz/harfbuzz/issues/2394 -->
     498
     499    hintmedium: is reported to be broken.
    305500    hintslight is the default: - supposed to be more fuzzy but retains shape.
    306501
     
    324519
    325520    <para>
    326       You will now need to edit the file in your preferred editor.
    327     </para>
     521      You will now need to edit the file in your preferred editor. Many of the
     522      different settings give very subtle differences and the results may differ
     523      for some of the fonts you use.
     524    </para>
     525
     526    <note>
     527      <para>
     528        Hinting, if enabled, is done in <application>FreeType</application>.
     529        Since FreeType-2.7 the default TrueType interpreter is v40. The
     530        original v35 hinter could be enabled by an environment variable, but
     531        is only really appropriate to original Microsoft TTF fonts (Arial, etc).
     532        The v38 hinter (Infinality) is not built by default and all the options
     533        to tune it have been removed. For full details see <xref
     534        linkend="subpixel-hinting"/> (Spoiler: there is NO sub-pixel hinting,
     535        the code simply ignores <emphasis>all</emphasis> horizontal hinting
     536        instructions.
     537      </para>
     538
     539      <para>
     540        Xorg assumes screens have 96 dots per inch (DPI). Most LCD screens are
     541        close to this, but some people detect colour fringing if their screen
     542        diverges from that size. See <xref linkend="calc-dpi"/>.
     543      </para>
     544
     545      <para>
     546        If you have a High DPI screen (often described as '4K' or larger) you
     547        will probably use larger font sizes and benefit from disabling hinting.
     548      </para>
     549    </note>
    328550
    329551    <para>
     
    347569      installed. Now, many people will not need to install any of them. But if
    348570      for some reason you have installed one or more bitmap fonts, you can
    349       prevent them from being used by <application>fontconfig</application> by
     571      prevent them from being used by <application>Fontconfig</application> by
    350572      creating the following file as the &root; user :
    351573    </para>
     
    368590  </sect2>
    369591
     592  <sect2 role="configuration" id="synthetic-changes" xreflabel="Synthetic changes">
     593  <title>Synthetic changes</title>
     594
     595  <para>
     596    In <filename>90-synthetic.conf</filename> there are examples of applying
     597    synthetic slanting and emboldening to a font. The synthetic emboldening can
     598    be applied to a visibly faint font, but the results are not always as
     599    expected: With just the embolden, <application>epiphany</application> showed
     600    darker font, <application>firefox</application> did not - so although
     601    <application>cairo</application> is now used by
     602    <application>firefox</application> the comment about setting Weight is still
     603    valid. But setting both, <application>epiphany</application> will show bold text
     604    by default, but heavy text if markup for bold is used. In both cases, neither
     605    <application>libreOffice</application> nor <application>falkon</application>
     606    showed bolder text.
     607  </para>
     608
     609  </sect2>
     610
    370611  <sect2 role="configuration" id="adding-extra-directories" xreflabel="Adding extra font directories">
    371612  <title>Adding extra font directories</title>
     
    414655          system in a newer version, and if you have multiple versions of a font
    415656          it is unclear which one will be used by
    416           <application>fontconfig</application>.
     657          <application>Fontconfig</application>.
    417658        </para>
    418659      </listitem>
     
    452693
    453694    <para>
    454       There are many reasons why people may wish to have pages which specify a
    455       particular font use a different font, or prefer specific fonts in
    456       Monospace or Sans or Serif. As you will expect, there a number of
    457       different ways of achieving this.
     695      With the exception of web pages which use WOFF fonts and either supply
     696      them or link to google to download them, web pages have traditionally
     697      suggested a list of preferred font family names if they cared (e.g.
     698      Times New Roman, Serif). There are many reasons why people may wish to
     699      have pages which specify a  preferred font use a different font, or
     700      prefer specific fonts in Monospace or Sans or Serif. As you will expect,
     701      there a number of different ways of achieving this.
    458702    </para>
    459703
    460704    <bridgehead renderas="sect3" id="fontconfig-user-docs"
    461     xreflabel="fontconfig-user-docs">Fontconfig user docs</bridgehead>
     705    xreflabel="Fontconfig user documentation">Fontconfig user documentation</bridgehead>
    462706
    463707      <para>
     
    482726
    483727    <bridgehead renderas="sect3" id="prefer-a-specific-font"
    484     xreflabel="fontconfig-prefer-specific-font">Prefer a specific font</bridgehead>
     728    xreflabel="Prefer a specific font">Prefer a specific font</bridgehead>
    485729
    486730      <para>
     
    501745&lt;!-- prefer Nimbus Roman No9 L for Times New Roman as well as for Times,
    502746 without this Tinos and Liberation Serif take precedence for Times New Roman
    503  before fontconfig falls back to whatever matches Times --&gt;
     747 before Fontconfig falls back to whatever matches Times --&gt;
    504748    &lt;alias binding="same"&gt;
    505749        &lt;family&gt;Times New Roman&lt;/family&gt;
     
    530774        font, meaning that only Kana symbols will be used from the Japanese
    531775        font, or to not specify DejaVu so that the first font in each set
    532         of preferences is preferred for text using latin alphabets.
     776        of preferences is preferred for text using Latin alphabets.
    533777      </para>
    534778
     
    544788            <xref linkend="wenquanyi-zenhei"/>  (Sans, but a default for Serif
    545789            and monospace) is used. A previous version of this page mentioned
    546             using UMing which is a traditional-style Chinese font that ships
     790            using UMing which is a Traditional Chinese font that ships
    547791            with an old conf file preferring it for zh-tw and zh-hk language
    548792            codes (and for sans-serif and monospace). But without the conf file,
    549             fontconfig will only treat it as suitable for zh-hk.
     793            <application>Fontconfig</application> will only treat it as suitable
     794            for zh-hk.
    550795            The conf file needs to be edited to current style and will then be
    551796            prepended, so specifying UMing does not belong in this
     
    622867      installed in <filename class="directory">/etc/fonts/conf.d</filename>.
    623868      However, if you do that and then use a terminal to run any command which
    624       uses <application>fontconfig</application> you may see error messages such
     869      uses <application>Fontconfig</application> you may see error messages such
    625870      as :
    626871    </para>
     
    634879    <para>
    635880      In practice, these old rules do not work. For non-CJK users,
    636       <application>fontconfig</application> will usually do a good job
     881      <application>Fontconfig</application> will usually do a good job
    637882      <emphasis>without</emphasis> these rules. Their origin dates back to when
    638883      CJK users needed handcrafted bitmaps to be legible at small sizes, and
     
    706951    </para>
    707952
     953    <bridgehead renderas="sect3" id="font-weights"
     954    xreflabel="About font weights">About font weights</bridgehead>
     955
     956    <para>
     957      When this page and the next page were first created, Latin fonts came
     958      with a  maximum of two weights - either Regular or Book (Book typically
     959      has a larger X-height to make it easier to read in large blocks of text),
     960      and  Bold - and perhaps an Italic (or Slant) style. A few fonts also had
     961      Condensed faces (to fit more text into a line and usually only used when
     962      specified). Without CSS (Cascading Style Sheets) markup, text used the
     963      Regular or Book weight except when &lt;b&gt; ... &lt;/b&gt; markup was
     964      used for bold text. Italic styles would be invoked by &lt;i&gt; ... &lt;/i&gt;
     965      markup, along with the bold markup for Bold Italic.
     966    </para>
     967
     968    <para>
     969      Some faces now contain up to 9 weights, possibly also with a variable font
     970      (to save space by including all the alternatives in one file and possibly
     971      allowing intermediate weights). For most desktop users who do not need this
     972      wide range of weights for creating content, it is simpler to only install
     973      one or two weights. If a face has individual weights plus a variable font,
     974      the variable font is usually in the top level of the supplied directory,
     975      with individual weights in a <filename class="directory">static/</filename>
     976      subdirectory. Except when initially reviewing a font, it makes no sense to
     977      install both static and variable, nor all the possible weights.
     978    </para>
     979
     980    <para>
     981      The weights are labelled from 100 (Thin) to 900 (Black or Heavy) in CSS
     982      terminology, with 400 being normal and 700 bold. The full set of weights
     983      is described at <xref linkend="css-weights"/>.
     984    </para>
     985
     986    <para>
     987      If you have installed a font with a range of weights, you can copy <ulink
     988      url="https://&lfs-domainname;/~ken/font-weights.html">font-weights.html</ulink>
     989      to your local machine. As shiped it will use your default Serif font assuming
     990      you have one. Edit it to point to a specific installed font using the name
     991      known to <application>Fontconfig</application> (also in the *EDITME FONTNAME*
     992      text items) and open it
     993      from your desktop browser. You can also use it to look at a font with only
     994      two installed weights, e.g. for testing to see if you prefer other weights.
     995    </para>
     996
     997    <para>
     998      Despite the details in that Mozilla link, it appears that if only normal and
     999      bold weights are installed, SemiBold (600) will be shown using bold.
     1000    </para>
     1001
     1002    <para>
     1003      There seems to be a little scope for changing which weights are used for
     1004      normal and bold <emphasis>if only two weights have been installed</emphasis>.
     1005      Firefox, and probably other browsers, will look for the next weight heavier
     1006      than normal. If that is less than bold (Medium, maybe SemiBold - uncertain)
     1007      it will be used for normal and then the next higher weight, if any will be
     1008      used for bold, allowing you to make the fonts slightly darker. Conversely,
     1009      if only a weight less than normal has been installed, such as Light, that
     1010      will be used for both normal and bold weights (the upward search happens
     1011      first).
     1012    </para>
     1013
     1014    <para>
     1015      If you remove some weights of a system font, you may need to run
     1016      <command>fc-cache</command> as the &root; user and then log out completely
     1017      to clear caches associated with your user.
     1018      <!-- I don't know for sure that there are user caches retained until you
     1019     log out, but certainly leaving X and restarting the browser is not always
     1020     adequate : ken -->
     1021    </para>
     1022
     1023    <bridgehead renderas="sect3" id="items-which-can-override-fontconfig"
     1024    xreflabel="Items which can override fontconfig">Items which can override Fontconfig</bridgehead>
     1025
     1026    <para>
     1027      Several desktop environments, as well as some programs, will use
     1028      <application>Fontconfig</application>
     1029      to find fonts but may override certain things.
     1030    </para>
     1031
     1032    <para>
     1033      <application>GNOME</application>: The settings in
     1034      org.gnome.desktop.interface can be updated with
     1035      <application>dconf-editor</application>. You can set the fonts to your
     1036      preference and desired point size. To use the fonts chosen by
     1037      <application>Fontconfig</application> specify e.g. 'Sans 12', Serif 11',
     1038      'Mono 10' as desired. Also review the antialiasing, hinting and rgba
     1039      settings.
     1040    </para>
     1041
     1042    <para>
     1043      <application>LXQt</application>: Change font settings as necessary to
     1044      match <application>Fontconfig</application> in
     1045      <application>lxqt-config-appearance</application>.
     1046    </para>
     1047
     1048    <para>
     1049      <application>KDE Plasma</application>: The settings can be adjusted in
     1050      <application>System Settings</application> under Appearance -> Fonts. This
     1051      will create or modify <filename>~/.config/fontconfig/fonts.conf</filename>
     1052      although <filename>~/.config/fontconfig/fonts.conf</filename>, if
     1053      installed, can override that.
     1054    </para>
     1055
     1056    <para>
     1057      i<application>Xfce desktop</application>: The settings can be adjusted in
     1058      <application>Settings</application> Appearance -> Fonts. Specify your
     1059      preferred fonts, e.g. 'Sans Regular' (to use the normal face and weight
     1060      rather than Bold and/or Italic) and adjust the point size in the option.
     1061      Review the Rendering and DPI options.
     1062    </para>
     1063
     1064    <para>
     1065      <application>Firefox</application>: This browser allows you to specify its
     1066      default fonts. For the 115esr series use the 'Hamburger' menu to go to
     1067      Preferences, General, and under Fonts -> Advanced select Sans Serif, Serif
     1068      or Monospace as appropriate if you wish to use the fonts which match
     1069      <application>Fontconfig</application>.  Set the point sizes as desired. In
     1070      later versions, the settings are at Preferences -> Fonts.
     1071      <!-- FIXME : Ken - when merging, add note in packages to update this when next ESR
     1072      series is used -->
     1073    </para>
     1074
     1075    <para>
     1076      <application>Libreoffice</application>: Tests using English text with an
     1077      old Japanese font (HanaMinA) which supports several European languages but
     1078      had only one weight and no italics or slant showed that although
     1079      <application>Libreoffice</application> uses
     1080      <application>Fontconfig</application> to find the font, it created its own
     1081      bold or slanted text. It is not clear if it will do the same where a font
     1082      actually has bold weight or an italic style. Also, documentation shows
     1083      that <application>Libreoffice</application> has its own substitution rules
     1084      for when a codepoint is not found in the selected font, but is unclear if
     1085      those rules apply on Linux using Fontconfig.
     1086    </para>
     1087
     1088    <para>
     1089      <application>Pango</application>: as noted in the example
     1090      <filename>~/.config/fontconfig</filename> above, anything using Pango-1.44
     1091      (from 2019) or later now uses <application>Harfbuzz</application> for
     1092      hinting, not <application>FreeType</application>, and
     1093      <literal>hintfull</literal> is not supported.
     1094    </para>
     1095
    7081096  </sect2>
    7091097
    710 
    711   <sect2 role="configuration" id="see-also" xreflabel="See Also">
    712   <title>See Also</title>
     1098  <sect2 role="configuration" id="external-links" xreflabel="External Links">
     1099  <title>External Links</title>
    7131100
    7141101    <bridgehead renderas="sect3" id="I-stared-into-the-fontconfig"
     
    7181105      The blog entries by <ulink
    7191106      url="https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/">Eevee</ulink>
    720       are particularly useful if <application>fontconfig</application> does not
     1107      are particularly useful if <application>Fontconfig</application> does not
    7211108      think your chosen font supports your language, and for preferring some
    7221109      non-MS Japanese fonts when an ugly MS font is already installed.
     1110    </para>
     1111
     1112    <bridgehead renderas="sect3" id="subpixel-hinting"
     1113    xreflabel="subpixel-hinting">subpixel-hinting</bridgehead>
     1114
     1115    <para>The documentation of the FreeType v40 interpreter at <ulink
     1116      url="https://freetype.org/freetype2/docs/hinting/subpixel-hinting.html">freetype
     1117      docs</ulink>
     1118      explains how the current hinter works, and why the previous (slow) Infinality
     1119      interpreter was replaced.
     1120    </para>
     1121
     1122    <bridgehead renderas="sect3" id="calc-dpi"
     1123    xreflabel="calc-dpi">Calculating DPI</bridgehead>
     1124
     1125    <para>An old answer at <ulink
     1126      url="https://askubuntu.com/questions/197828/how-to-find-and-change-the-screen-dpi/">askubuntu</ulink>
     1127      gives some detail on calculating a screen's dots per inch, but essentailly
     1128      you just measure the width and height of the visible panel, convert to
     1129      inches if using metric measurements, and divide by the number of pixels.
     1130      You can then pass <option>-dpi <replaceable>90</replaceable></option> when
     1131      you start Xorg, using your own value.
     1132    </para>
     1133
     1134    <bridgehead renderas="sect3" id="css-weights"
     1135    xreflabel="Table of CSS font weights">Table of CSS font weights</bridgehead>
     1136
     1137    <para>Perhaps more than you ever wished to know is at <ulink
     1138      url="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight">Mozilla
     1139      CSS docs</ulink>.
     1140    </para>
     1141
     1142    <bridgehead renderas="sect3" id="ttfautohint"
     1143    xreflabel="Applying autohinting to a font">Applying autohinting to a font</bridgehead>
     1144
     1145    <para>
     1146      If you are using hinting and have a TTF (not OTF) font which lacks hints
     1147      but permits you to fork it, you might be able to apply hints using <ulink
     1148      url="https://freetype.org/ttfautohint/">ttfautohint</ulink> which is based
     1149      on the old autohinter. As of version 1.8.4 it fails to build without Qt5.
     1150      <!-- switch exists, configure passes but build fails -->
    7231151    </para>
    7241152
Note: See TracChangeset for help on using the changeset viewer.