source: x/installing/tuning-fontconfig.xml@ 9c1319c

12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon trunk xry111/llvm18
Last change on this file since 9c1319c was 9c1319c, checked in by Ken Moffat <ken@…>, 7 months ago

tuningfonts -

Make all internal sections of tuning-fontconfig Sect2 so that the
titles are all in the same font size.

  • Property mode set to 100644
File size: 50.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="tuning-fontconfig">
9 <?dbhtml filename="tuning-fontconfig.html"?>
10
11
12 <title>Tuning Fontconfig</title>
13
14 <indexterm zone="tuning-fontconfig">
15 <primary sortas="g-tuning-fontconfig">Tuning Fontconfig</primary>
16 </indexterm>
17
18 <sect2 id='fontconfig-overview' xreflabel="Overview of Fontconfig">
19 <title>Overview of Fontconfig</title>
20
21<!-- do not add individual indexterm entries for items within this page, they
22 all belong in section G (others) and not only do they add noise in longindex,
23 the links all point to the top of the page. -->
24
25 <para>
26 If you only read text in English, and are happy with the common libre
27 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
29 many things which can be altered if they do not suit your needs.
30 </para>
31
32 <para>
33 Although this page is long, it barely scratches the surface and you will
34 be able to find many alternative views on the web (but please remember
35 that some things have changed over the years, for example the autohinter
36 is no longer the default). The aim here is to give you enough information
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>
100
101 </sect2>
102
103 <sect2 role="configuration" id="xft-font-protocol" xreflabel="The Xft Font Protocol">
104 <title>The Xft Font Protocol</title>
105
106 <para>
107 The Xft font protocol provides antialiased font rendering through
108 <application>freetype</application>, and fonts are controlled from the
109 client side using <application>Fontconfig</application> (except for
110 <xref linkend="rxvt-unicode"/> which can use fonts listed in
111 <filename>~/.Xresources</filename>, and <xref linkend="abiword"/> which
112 only uses the specified font). The default search path is <filename
113 class="directory">/usr/share/fonts</filename> and <filename
114 class="directory">~/.local/share/fonts</filename>, although for the moment
115 the old and deprecated location <filename
116 class="directory">~/.fonts</filename> still works.
117 <application>Fontconfig</application> searches directories in its path
118 recursively and maintains a cache of the font characteristics in each
119 directory. If the cache appears to be out of date, it is ignored, and
120 information is fetched from the fonts themselves (that can take a few
121 seconds if you have a lot of fonts installed).
122 </para>
123
124 <para>
125 If you've installed <application>Xorg</application> in any prefix
126 other than <filename class="directory">/usr</filename>, any
127 <application>X</application> fonts were not installed in a
128 location known to <application>Fontconfig</application>. Symlinks were
129 <!-- fonts-misc-ethiopic installs an OTF directory ! -->
130 created from the <filename class="directory">OTF</filename> and <filename
131 class="directory">TTF</filename> <application>X</application> font
132 directories to <filename
133 class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This allows
134 <application>Fontconfig</application> to use the OpenType and TrueType
135 fonts provided by <application>X</application>, although many people will
136 prefer to use more modern fonts.
137 </para>
138
139 <para>
140 <application>Fontconfig</application> uses names to define fonts.
141 Applications generally use generic font names such as "Monospace", "Sans"
142 and "Serif". <application>Fontconfig</application> resolves these names
143 to a font that has all characters that cover the orthography of the
144 language indicated by the locale settings.
145 </para>
146
147 </sect2>
148
149 <sect2 role="configuration" id="useful-commands" xreflabel="Useful Commands">
150 <title>Useful Commands</title>
151
152 <para>
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.
157 </para>
158
159 <para>
160 <command>fc-list | less</command> : shows a list of all available fonts
161 (/path/to/filename: Font Name:style). If you installed a font more than
162 30 seconds ago but it does not show, then it or one of its directories is
163 not readable by your user.
164 </para>
165
166 <para>
167 <command>fc-match 'Font Name'</command> : tells you which font will
168 be used if the named font is requested. Typically you would use this to
169 see what happens if a font you have not installed is requested, but you
170 can also use it if the system is giving you a different font from
171 what you expected (perhaps because <application>Fontconfig</application>
172 does not think that the font supports your language).
173 </para>
174
175 <para>
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)'.
202 </para>
203
204 <para>
205 If you wish to know which font will be used for a string of text
206 (i.e. one or more glyphs, preceded by a space), paste the following
207 command and replace the <literal>xyz</literal> by the text you care
208 about:
209 </para>
210
211 <para>
212 <command>FC_DEBUG=4 pango-view --font=monospace -t xyz | grep
213 family</command> : this requires <xref linkend="pango"/> and <xref
214 linkend="imagemagick"/> - it will invoke <xref linkend="display"/>
215 to show the text in a tiny window, and after closing that the last
216 line of the output will show which font was chosen. This is
217 particularly useful for CJK languages, and you can also pass a
218 language, e.g. PANGO_LANGUAGE=en;ja (English, then assume Japanese)
219 or just zh-cn (or other variants such as zh-sg or zh-tw).
220 </para>
221
222 </sect2>
223
224 <sect2 role="configuration" id="the-various-files" xreflabel="The configuration files">
225 <title>The configuration files</title>
226
227 <para>
228 The main files are in <filename class="directory">/etc/fonts/conf.d/</filename>,
229 which was intended to be a directory populated by symlinks to some of the files
230 in <filename class="directory">/usr/share/fontconfig/conf.avail/</filename>.
231 But many people, and some packages, create the files directly. Each file name
232 must be in the form of two digits, a dash, somename.conf and they are read in
233 sequence.
234 </para>
235
236 <para>
237 By convention, the numbers are assigned as follows:
238 </para>
239
240 <itemizedlist>
241 <listitem>
242 <para>
243 00-09 extra font directories
244 </para>
245 </listitem>
246 <listitem>
247 <para>
248 10-19 system rendering defaults (such as antialiasing)
249 </para>
250 </listitem>
251 <listitem>
252 <para>
253 20-29 font rendering options
254 </para>
255 </listitem>
256 <listitem>
257 <para>
258 30-39 family substitution
259 </para>
260 </listitem>
261 <listitem>
262 <para>
263 40-49 map family to generic type
264 </para>
265 </listitem>
266 <listitem>
267 <para>
268 50-59 load alternate config files
269 </para>
270 </listitem>
271 <listitem>
272 <para>
273 60-69 generic aliases, map generic to family
274 </para>
275 </listitem>
276 <listitem>
277 <para>
278 70-79 adjust which fonts are available
279 </para>
280 </listitem>
281 <listitem>
282 <para>
283 80-89 match target scan (modify scanned patterns)
284 </para>
285 </listitem>
286 <listitem>
287 <para>
288 90-99 font synthesis
289 </para>
290 </listitem>
291 </itemizedlist>
292
293 <para>
294 You can also have a personal <filename>fonts.conf</filename> in
295 $XDG_CONFIG_HOME (which is <filename
296 class="directory">~/.config/fontconfig/</filename>).
297 </para>
298
299 </sect2>
300
301 <sect2 role="configuration" id="rules-to-choose-a-font" xreflabel="The rules to choose a font">
302 <title>The rules to choose a font</title>
303
304 <para>
305 If the requested font is installed, and provided it contains the
306 codepoints <emphasis>required</emphasis> for the current language (in the
307 source, see the .orth files in the <filename
308 class="directory">fc-lang/</filename> directory), it will be used.
309 </para>
310
311 <para>
312 However, if the document or page requested a font which is not installed
313 (or, occasionally, does not contain all the required codepoints) the
314 following rules come into play: First,
315 <filename>30-metric-aliases.conf</filename> is used to map aliases for
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"/>
337 will be used if you installed them. Cyrillic and Greek appear to be
338 treated in the same way.All of these files prefer
339 commercial fonts if they are present, although modern libre fonts are
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
443 emoji and math fonts, please see {45,60}-generic.conf.
444 </para>
445
446 <para>
447 In the rare cases where a font does not contain all the expected
448 codepoints, see 'Trial the First:' at <xref
449 linkend="I-stared-into-the-fontconfig"/> for the long details.
450 </para>
451
452 </sect2>
453
454 <sect2 role="configuration" id="hinting-and-antialiasing" xreflabel="Hinting and Anti-aliasing">
455 <title>Hinting and Anti-aliasing</title>
456
457 <para>
458 It is possible to change how, or if, fonts are hinted. The following
459 example file contains the default settings, but with comments. The
460 settings are very much down to the user's preferences and to the choice
461 of fonts, so a change which improves some pages may worsen others. The
462 preferred location for this file is:
463 <filename>~/.config/fontconfig/fonts.conf</filename>
464 </para>
465
466 <para>
467 To try out different settings, you may need to exit from Xorg and then
468 run <command>startx</command> again so that all applications use the new
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:
472 </para>
473
474<screen><userinput>mkdir -pv ~/.config/fontconfig &amp;&amp;
475cat > ~/.config/fontconfig/fonts.conf &lt;&lt; "EOF"
476<literal>&lt;?xml version='1.0'?&gt;
477&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
478&lt;fontconfig&gt;
479
480 &lt;match target="font" &gt;
481 &lt;!-- autohint was the old automatic hinter when hinting was patent
482 protected, so turn it off to ensure any hinting information in the font
483 itself is used, this is the default --&gt;
484 &lt;edit mode="assign" name="autohint"&gt; &lt;bool&gt;false&lt;/bool&gt;&lt;/edit&gt;
485
486 &lt;!-- hinting is enabled by default --&gt;
487 &lt;edit mode="assign" name="hinting"&gt; &lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt;
488
489 &lt;!-- for the lcdfilter see https://www.spasche.net/files/lcdfiltering/ --&gt;
490 &lt;edit mode="assign" name="lcdfilter"&gt; &lt;const&gt;lcddefault&lt;/const&gt;&lt;/edit&gt;
491
492 &lt;!-- options for hintstyle:
493 hintfull: is supposed to give a crisp font that aligns well to the
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.
500 hintslight is the default: - supposed to be more fuzzy but retains shape.
501
502 hintnone: seems to turn hinting off.
503 The variations are marginal and results vary with different fonts --&gt;
504 &lt;edit mode="assign" name="hintstyle"&gt; &lt;const&gt;hintslight&lt;/const&gt;&lt;/edit&gt;
505
506 &lt;!-- antialiasing is on by default and really helps for faint characters
507 and also for 'xft:' fonts used in rxvt-unicode --&gt;
508 &lt;edit mode="assign" name="antialias"&gt; &lt;bool&gt;true&lt;/bool&gt;&lt;/edit&gt;
509
510 &lt;!-- subpixels are usually rgb, see
511 http://www.lagom.nl/lcd-test/subpixel.php --&gt;
512 &lt;edit mode="assign" name="rgba"&gt; &lt;const&gt;rgb&lt;/const&gt;&lt;/edit&gt;
513
514 &lt;!-- thanks to the Arch wiki for the lcd and subpixel links --&gt;
515 &lt;/match&gt;
516
517&lt;/fontconfig&gt;</literal>
518EOF</userinput></screen>
519
520 <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>
550
551 <para>
552 For more examples see the blfs-support thread which started at <ulink
553 url="https://lists.linuxfromscratch.org/sympa/arc/blfs-support/2016-09/msg00128.html">2016-09/00128</ulink>,
554 particularly <ulink
555 url="https://lists.linuxfromscratch.org/sympa/arc/blfs-support/2016-09/msg00137.html">2016-09/00137</ulink>,
556 and the original poster's preferred solution at <ulink
557 url="https://lists.linuxfromscratch.org/sympa/arc/blfs-support/2016-09/msg00147.html">2016-09/00147</ulink>.
558 There are other examples in <xref linkend="arch-fontconfig"/> and <xref
559 linkend="gentoo-fontconfig"/>.
560 </para>
561
562 </sect2>
563
564 <sect2 role="configuration" id="disabling-bitmap-fonts" xreflabel="Disabling Bitmap fonts">
565 <title>Disabling Bitmap Fonts</title>
566
567 <para>
568 In previous versions of BLFS, the ugly old Xorg bitmap fonts were
569 installed. Now, many people will not need to install any of them. But if
570 for some reason you have installed one or more bitmap fonts, you can
571 prevent them from being used by <application>Fontconfig</application> by
572 creating the following file as the &root; user :
573 </para>
574
575<screen role="root"><userinput>cat > /etc/fonts/conf.d/70-no-bitmaps.conf &lt;&lt; "EOF"
576<literal>&lt;?xml version='1.0'?&gt;
577&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
578&lt;fontconfig&gt;
579&lt;!-- Reject bitmap fonts --&gt;
580 &lt;selectfont&gt;
581 &lt;rejectfont&gt;
582 &lt;pattern&gt;
583 &lt;patelt name="scalable"&gt;&lt;bool&gt;false&lt;/bool&gt;&lt;/patelt&gt;
584 &lt;/pattern&gt;
585 &lt;/rejectfont&gt;
586 &lt;/selectfont&gt;
587&lt;/fontconfig&gt;</literal>
588EOF</userinput></screen>
589
590 </sect2>
591
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
611 <sect2 role="configuration" id="adding-extra-directories" xreflabel="Adding extra font directories">
612 <title>Adding extra font directories</title>
613
614 <para>
615 Normally, system fonts and user fonts are installed in directories beneath
616 the locations specified in <xref linkend="xft-font-protocol"/> and there
617 is no obvious reason to put them elsewhere. However, a full BLFS install
618 of <xref linkend="texlive"/> puts many fonts in <filename
619 class="directory">/opt/texlive/&texlive-year;/texmf-dist/fonts/</filename>
620 in the <filename class="directory">opentype/</filename> and <filename
621 class="directory">truetype/</filename> subdirectories. Although pulling in
622 all of these files may appear useful (it allows you to use them in non
623 <application>TeX</application> programs), there are several problems with
624 such an approach:
625 </para>
626
627 <orderedlist>
628 <listitem>
629 <para>
630 There are hundreds of files, which makes selecting fonts difficult.
631 </para>
632 </listitem>
633 <listitem>
634 <para>
635 Some of the files do odd things, such as displaying semaphore flags
636 instead of ASCII letters, or mapping cyrillic codepoints to character
637 forms appropriate to Old Church Slavonic instead of the expected
638 current shapes: fine if that is what you need, but painful for normal
639 use.
640 </para>
641 </listitem>
642 <listitem>
643 <para>
644 Several fonts have multiple sizes and impenetrable short names, which
645 both make selecting the correct font even more difficult.
646 </para>
647 </listitem>
648 <listitem>
649 <para>
650 When a font is added to CTAN, it is accompanied by TeX packages to use
651 it in the old engines (<application>xelatex</application> does not
652 normally need this), and then the version is often frozen whilst the
653 font is separately maintained. Some of these fonts such as <xref
654 linkend="dejavu-fonts"/> are probably already installed on your BLFS
655 system in a newer version, and if you have multiple versions of a font
656 it is unclear which one will be used by
657 <application>Fontconfig</application>.
658 </para>
659 </listitem>
660 </orderedlist>
661
662 <para>
663 However, it is sometimes useful to look at these fonts in non-TeX
664 applications, if only to see whether you wish to install a current
665 version. If you have installed all of <application>texlive</application>,
666 the following example will make one of the Arkandis Open Type fonts
667 available to other applications, and all three of the ParaType TrueType
668 fonts. Adjust or repeat the lines as desired, to either make all the
669 <filename class="directory">opentype/</filename> or <filename
670 class="directory">truetype</filename>fonts available, or to select
671 different font directories. As the <systemitem
672 class="username">root</systemitem> user:
673 </para>
674
675<screen role="root"><userinput>cat > /etc/fonts/conf.d/09-texlive.conf &lt;&lt; "EOF"
676<literal>&lt;?xml version='1.0'?&gt;
677&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
678&lt;fontconfig&gt;
679 &lt;dir&gt;/opt/texlive/&texlive-year;/texmf-dist/fonts/opentype/arkandis/berenisadf&lt;/dir&gt;
680 &lt;dir&gt;/opt/texlive/&texlive-year;/texmf-dist/fonts/truetype/paratype&lt;/dir&gt;
681&lt;/fontconfig&gt;</literal>
682EOF</userinput></screen>
683
684 <para>
685 If you do this, remember to change all instances of the year in that file
686 when you upgrade <application>texlive</application> to a later release.
687 </para>
688
689 </sect2>
690
691 <sect2 role="configuration" id="preferring-certain-fonts" xreflabel="Preferring certain fonts">
692 <title>Preferring certain fonts</title>
693
694 <para>
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.
702 </para>
703
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>
743
744<screen><userinput>mkdir -pv ~/.config/fontconfig/conf.d &amp;&amp;
745cat > ~/.config/fontconfig/conf.d/35-prefer-nimbus-for-timesnew.conf &lt;&lt; "EOF"
746<literal>&lt;?xml version='1.0'?&gt;
747&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
748&lt;fontconfig&gt;
749&lt;!-- prefer Nimbus Roman No9 L for Times New Roman as well as for Times,
750 without this Tinos and Liberation Serif take precedence for Times New Roman
751 before Fontconfig falls back to whatever matches Times --&gt;
752 &lt;alias binding="same"&gt;
753 &lt;family&gt;Times New Roman&lt;/family&gt;
754 &lt;accept&gt;
755 &lt;family&gt;Nimbus Roman No9 L&lt;/family&gt;
756 &lt;/accept&gt;
757 &lt;/alias&gt;
758&lt;/fontconfig&gt;</literal>
759EOF</userinput></screen>
760
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>
830
831<screen role="root"><userinput>cat > /etc/fonts/local.conf &lt;&lt; "EOF"
832<literal>&lt;?xml version='1.0'?&gt;
833&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
834&lt;fontconfig&gt;
835 &lt;alias&gt;
836 &lt;family&gt;serif&lt;/family&gt;
837 &lt;prefer&gt;
838 &lt;family&gt;DejaVu Serif&lt;/family&gt;
839 &lt;family&gt;IPAexMincho&lt;/family&gt;
840 &lt;!-- WenQuanYi is preferred as Serif in 65-nonlatin.conf,
841 override that so a real Korean font can be used for Serif --&gt;
842 &lt;family&gt;UnBatang&lt;/family&gt;
843 &lt;/prefer&gt;
844 &lt;/alias&gt;
845 &lt;alias&gt;
846 &lt;family&gt;sans-serif&lt;/family&gt;
847 &lt;prefer&gt;
848 &lt;family&gt;DejaVu Sans&lt;/family&gt;
849 &lt;family&gt;VL Gothic&lt;/family&gt;
850 &lt;!-- This assumes WenQuanYi is good enough for Korean Sans --&gt;
851 &lt;/prefer&gt;
852 &lt;/alias&gt;
853 &lt;alias&gt;
854 &lt;family&gt;monospace&lt;/family&gt;
855 &lt;prefer&gt;
856 &lt;family&gt;DejaVu Sans Mono&lt;/family&gt;
857 &lt;family&gt;VL Gothic&lt;/family&gt;
858 &lt;!-- This assumes WenQuanYi is good enough for Korean Monospace --&gt;
859 &lt;/prefer&gt;
860 &lt;/alias&gt;
861&lt;/fontconfig&gt;</literal>
862EOF</userinput></screen>
863
864 </sect2>
865
866 <sect2 role="configuration" id="editing-old-style-conf-files"
867 xreflabel="Editing Old-Style conf files">
868 <title>Editing Old-Style conf files</title>
869
870 <para>
871 Some fonts, particularly Chinese fonts, ship with conf files which can be
872 installed in <filename class="directory">/etc/fonts/conf.d</filename>.
873 However, if you do that and then use a terminal to run any command which
874 uses <application>Fontconfig</application> you may see error messages such
875 as :
876 </para>
877
878 <para>
879 <literal>Fontconfig warning: "/etc/fonts/conf.d/69-odofonts.conf", line
880 14: Having multiple &lt;family&gt; in &lt;alias&gt; isn't supported and
881 may not work as expected</literal>.
882 </para>
883
884 <para>
885 In practice, these old rules do not work. For non-CJK users,
886 <application>Fontconfig</application> will usually do a good job
887 <emphasis>without</emphasis> these rules. Their origin dates back to when
888 CJK users needed handcrafted bitmaps to be legible at small sizes, and
889 those looked ugly next to antialiased Latin glyphs - they preferred to
890 use the same CJK font for the Latin glyphs. There is a side-effect of
891 doing this : the (Serif) font is often also used for Sans, and in such a
892 situation the (English) text in <application>Gtk</application> menus will
893 use this font - compared to system fonts, as well as being serif it is
894 both faint and rather small. That can make it uncomfortable to read.
895 </para>
896
897 <para>
898 Nevertheless, these old conf files can be fixed if you wish to use them.
899 The following example is the first part of
900 <filename>64-arphic-uming.conf</filename> from <xref linkend="UMing"/> -
901 there are many more similar items which also need changing :
902 </para>
903
904 <para>
905 <literallayout>
906 &lt;match target="pattern"&gt;
907 &lt;test qual="any" name="lang" compare="contains"&gt;
908 &lt;string&gt;zh-cn&lt;/string&gt;
909 &lt;string&gt;zh-sg&lt;/string&gt;
910 &lt;/test&gt;
911 &lt;test qual="any" name="family"&gt;
912 &lt;string&gt;serif&lt;/string&gt;
913 &lt;/test&gt;
914 &lt;edit name="family" mode="prepend" binding="strong"&gt;
915 &lt;string&gt;AR PL UMing CN&lt;/string&gt;
916 &lt;/edit&gt;
917 &lt;/match&gt;</literallayout>
918 </para>
919
920 <para>
921 The process to correct this is straightforward but tedious - for every
922 item which produces an error message, using your editor (as the &root;
923 user), edit the installed
924 file to repeat the whole block as many times as there are multiple
925 variables, then reduce each example to have only one of them. You may
926 wish to work on one error at a time, save the file after each fix, and
927 from a separate term run a command such as <command>fc-list 2>&amp;1 |
928 less</command> to see that the fix worked. For the block above, the fixed
929 version will be :
930 </para>
931
932 <para>
933 <literallayout>
934 &lt;match target="pattern"&gt;
935 &lt;test qual="any" name="lang" compare="contains"&gt;
936 &lt;string&gt;zh-cn&lt;/string&gt;
937 &lt;/test&gt;
938 &lt;test qual="any" name="family"&gt;
939 &lt;string&gt;serif&lt;/string&gt;
940 &lt;/test&gt;
941 &lt;edit name="family" mode="prepend" binding="strong"&gt;
942 &lt;string&gt;AR PL UMing CN&lt;/string&gt;
943 &lt;/edit&gt;
944 &lt;/match&gt;
945 &lt;match target="pattern"&gt;
946 &lt;test qual="any" name="lang" compare="contains"&gt;
947 &lt;string&gt;zh-sg&lt;/string&gt;
948 &lt;/test&gt;
949 &lt;test qual="any" name="family"&gt;
950 &lt;string&gt;serif&lt;/string&gt;
951 &lt;/test&gt;
952 &lt;edit name="family" mode="prepend" binding="strong"&gt;
953 &lt;string&gt;AR PL UMing CN&lt;/string&gt;
954 &lt;/edit&gt;
955 &lt;/match&gt;</literallayout>
956 </para>
957
958 </sect2>
959
960 <sect2 role="configuration" id="font-weights" xreflabel="About font weights">
961 <title>About font weights</title>
962
963 <para>
964 When this page and the next page were first created, Latin fonts came
965 with a maximum of two weights - either Regular or Book (Book typically
966 has a larger X-height to make it easier to read in large blocks of text),
967 and Bold - and perhaps an Italic (or Slant) style. A few fonts also had
968 Condensed faces (to fit more text into a line and usually only used when
969 specified). Without CSS (Cascading Style Sheets) markup, text used the
970 Regular or Book weight except when &lt;b&gt; ... &lt;/b&gt; markup was
971 used for bold text. Italic styles would be invoked by &lt;i&gt; ... &lt;/i&gt;
972 markup, along with the bold markup for Bold Italic.
973 </para>
974
975 <para>
976 Some faces now contain up to 9 weights, possibly also with a variable font
977 (to save space by including all the alternatives in one file and possibly
978 allowing intermediate weights). For most desktop users who do not need this
979 wide range of weights for creating content, it is simpler to only install
980 one or two weights. If a face has individual weights plus a variable font,
981 the variable font is usually in the top level of the supplied directory,
982 with individual weights in a <filename class="directory">static/</filename>
983 subdirectory. Except when initially reviewing a font, it makes no sense to
984 install both static and variable, nor all the possible weights.
985 </para>
986
987 <para>
988 The weights are labelled from 100 (Thin) to 900 (Black or Heavy) in CSS
989 terminology, with 400 being normal and 700 bold. The full set of weights
990 is described at <xref linkend="css-weights"/>.
991 </para>
992
993 <para>
994 If you have installed a font with a range of weights, you can copy <ulink
995 url="https://&lfs-domainname;/~ken/font-weights.html">font-weights.html</ulink>
996 to your local machine. As shiped it will use your default Serif font assuming
997 you have one. Edit it to point to a specific installed font using the name
998 known to <application>Fontconfig</application> (also in the *EDITME FONTNAME*
999 text items) and open it
1000 from your desktop browser. You can also use it to look at a font with only
1001 two installed weights, e.g. for testing to see if you prefer other weights.
1002 </para>
1003
1004 <para>
1005 Despite the details in that Mozilla link, it appears that if only normal and
1006 bold weights are installed, SemiBold (600) will be shown using bold.
1007 </para>
1008
1009 <para>
1010 There seems to be a little scope for changing which weights are used for
1011 normal and bold <emphasis>if only two weights have been installed</emphasis>.
1012 Firefox, and probably other browsers, will look for the next weight heavier
1013 than normal. If that is less than bold (Medium, maybe SemiBold - uncertain)
1014 it will be used for normal and then the next higher weight, if any will be
1015 used for bold, allowing you to make the fonts slightly darker. Conversely,
1016 if only a weight less than normal has been installed, such as Light, that
1017 will be used for both normal and bold weights (the upward search happens
1018 first).
1019 </para>
1020
1021 <para>
1022 If you remove some weights of a system font, you may need to run
1023 <command>fc-cache</command> as the &root; user and then log out completely
1024 to clear caches associated with your user.
1025 <!-- I don't know for sure that there are user caches retained until you
1026 log out, but certainly leaving X and restarting the browser is not always
1027 adequate : ken -->
1028 </para>
1029
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>
1034
1035 <para>
1036 Several desktop environments, as well as some programs, will use
1037 <application>Fontconfig</application>
1038 to find fonts but may override certain things.
1039 </para>
1040
1041 <para>
1042 <application>GNOME</application>: The settings in
1043 org.gnome.desktop.interface can be updated with
1044 <application>dconf-editor</application>. You can set the fonts to your
1045 preference and desired point size. To use the fonts chosen by
1046 <application>Fontconfig</application> specify e.g. 'Sans 12', Serif 11',
1047 'Mono 10' as desired. Also review the antialiasing, hinting and rgba
1048 settings.
1049 </para>
1050
1051 <para>
1052 <application>LXQt</application>: Change font settings as necessary to
1053 match <application>Fontconfig</application> in
1054 <application>lxqt-config-appearance</application>.
1055 </para>
1056
1057 <para>
1058 <application>KDE Plasma</application>: The settings can be adjusted in
1059 <application>System Settings</application> under Appearance -> Fonts. This
1060 will create or modify <filename>~/.config/fontconfig/fonts.conf</filename>
1061 although <filename>~/.config/fontconfig/fonts.conf</filename>, if
1062 installed, can override that.
1063 </para>
1064
1065 <para>
1066 i<application>Xfce desktop</application>: The settings can be adjusted in
1067 <application>Settings</application> Appearance -> Fonts. Specify your
1068 preferred fonts, e.g. 'Sans Regular' (to use the normal face and weight
1069 rather than Bold and/or Italic) and adjust the point size in the option.
1070 Review the Rendering and DPI options.
1071 </para>
1072
1073 <para>
1074 <application>Firefox</application>: This browser allows you to specify its
1075 default fonts. For the 115esr series use the 'Hamburger' menu to go to
1076 Preferences, General, and under Fonts -> Advanced select Sans Serif, Serif
1077 or Monospace as appropriate if you wish to use the fonts which match
1078 <application>Fontconfig</application>. Set the point sizes as desired. In
1079 later versions, the settings are at Preferences -> Fonts.
1080 <!-- FIXME : Ken - when merging, add note in packages to update this when next ESR
1081 series is used -->
1082 </para>
1083
1084 <para>
1085 <application>Libreoffice</application>: Tests using English text with an
1086 old Japanese font (HanaMinA) which supports several European languages but
1087 had only one weight and no italics or slant showed that although
1088 <application>Libreoffice</application> uses
1089 <application>Fontconfig</application> to find the font, it created its own
1090 bold or slanted text. It is not clear if it will do the same where a font
1091 actually has bold weight or an italic style. Also, documentation shows
1092 that <application>Libreoffice</application> has its own substitution rules
1093 for when a codepoint is not found in the selected font, but is unclear if
1094 those rules apply on Linux using Fontconfig.
1095 </para>
1096
1097 <para>
1098 <application>Pango</application>: as noted in the example
1099 <filename>~/.config/fontconfig</filename> above, anything using Pango-1.44
1100 (from 2019) or later now uses <application>Harfbuzz</application> for
1101 hinting, not <application>FreeType</application>, and
1102 <literal>hintfull</literal> is not supported.
1103 </para>
1104
1105 </sect2>
1106
1107 <sect2 role="configuration" id="external-links" xreflabel="External Links">
1108 <title>External Links</title>
1109
1110 <bridgehead renderas="sect3" id="I-stared-into-the-fontconfig"
1111 xreflabel="I stared into the fontconfig">I stared into the fontconfig ...</bridgehead>
1112
1113 <para>
1114 The blog entries by <ulink
1115 url="https://eev.ee/blog/2015/05/20/i-stared-into-the-fontconfig-and-the-fontconfig-stared-back-at-me/">Eevee</ulink>
1116 are particularly useful if <application>Fontconfig</application> does not
1117 think your chosen font supports your language, and for preferring some
1118 non-MS Japanese fonts when an ugly MS font is already installed.
1119 </para>
1120
1121 <bridgehead renderas="sect3" id="subpixel-hinting"
1122 xreflabel="subpixel-hinting">subpixel-hinting</bridgehead>
1123
1124 <para>The documentation of the FreeType v40 interpreter at <ulink
1125 url="https://freetype.org/freetype2/docs/hinting/subpixel-hinting.html">freetype
1126 docs</ulink>
1127 explains how the current hinter works, and why the previous (slow) Infinality
1128 interpreter was replaced.
1129 </para>
1130
1131 <bridgehead renderas="sect3" id="calc-dpi"
1132 xreflabel="calc-dpi">Calculating DPI</bridgehead>
1133
1134 <para>An old answer at <ulink
1135 url="https://askubuntu.com/questions/197828/how-to-find-and-change-the-screen-dpi/">askubuntu</ulink>
1136 gives some detail on calculating a screen's dots per inch, but essentailly
1137 you just measure the width and height of the visible panel, convert to
1138 inches if using metric measurements, and divide by the number of pixels.
1139 You can then pass <option>-dpi <replaceable>90</replaceable></option> when
1140 you start Xorg, using your own value.
1141 </para>
1142
1143 <bridgehead renderas="sect3" id="css-weights"
1144 xreflabel="Table of CSS font weights">Table of CSS font weights</bridgehead>
1145
1146 <para>Perhaps more than you ever wished to know is at <ulink
1147 url="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight">Mozilla
1148 CSS docs</ulink>.
1149 </para>
1150
1151 <bridgehead renderas="sect3" id="ttfautohint"
1152 xreflabel="Applying autohinting to a font">Applying autohinting to a font</bridgehead>
1153
1154 <para>
1155 If you are using hinting and have a TTF (not OTF) font which lacks hints
1156 but permits you to fork it, you might be able to apply hints using <ulink
1157 url="https://freetype.org/ttfautohint/">ttfautohint</ulink> which is based
1158 on the old autohinter. As of version 1.8.4 it fails to build without Qt5.
1159 <!-- switch exists, configure passes but build fails -->
1160 </para>
1161
1162 <bridgehead renderas="sect3" id="arch-fontconfig"
1163 xreflabel="Fontconfig in the Arch wiki">Fontconfig in the Arch wiki</bridgehead>
1164
1165 <para>
1166 Arch has a lot of information in its wiki at <ulink
1167 url="https://wiki.archlinux.org/index.php/font_configuration">font_configuration</ulink>.
1168 </para>
1169
1170 <bridgehead renderas="sect3" id="gentoo-fontconfig"
1171 xreflabel="Fontconfig in the Gentoo wiki">Fontconfig in the Gentoo wiki</bridgehead>
1172
1173 <para>
1174 Gentoo has some information in its wiki at <ulink
1175 url="https://wiki.gentoo.org/wiki/Fontconfig">Fontconfig</ulink> although
1176 a lot of the details (what to enable, and Infinality) are specific to
1177 Gentoo.
1178 </para>
1179
1180 </sect2>
1181
1182</sect1>
Note: See TracBrowser for help on using the repository browser.