1 ▶ Documentation for remapping-font-template.conf
3 This advanced template makes it possible to remap bad font metadata to correct
4 values at the fontconfig level. It is composed of four rules:
5 — the first one (the actual remapping block) detects fonts that declare
6 [problemfontname],[problemfontstyle] and remaps them to
7 [correctedfontname],[correctedfontstyle]. You can remap other attributes, use
8 fc-query to see what a font file declares and fc-scan to check how you
10 — the second one is similar to our substitution rule, and is used to alias
11 [problemfontname] to [correctedfontstyle]. This is necessary to avoid
12 breaking documents that reference the broken font naming hidden by the
13 previous rule. (it does not take the style into account because
14 unfortunately fontconfig can not handle it right now)
15 — the third one tells fontconfig it can use the font named [correctedfontname]
16 when an application asks for the generic family [genericname].
17 — the fourth one tells fontconfig it can complete the font named
18 [correctedfontname] with glyphs taken from fonts registered under
21 If the problem font includes more than one style, you will have to repeat the
22 two first blocks for each [problemfontname],[problemfontstyle] couple needing
23 fixing. The two last rules are similar to what we do in all our other
26 This kind of remapping is necessary because there were few conventions for font
27 naming for a long time, and some font creators put random garbage in there
28 (also some fonts were converted from older legacy formats while keeping
29 the metadata limitations of those formats, and some authors even released fonts
30 with plain typos in their metadata). Now that the two main companies behind the
31 OpenType spec, Adobe and Microsoft, specified strict conventions (to help
32 applications make sense of available fonts), all those font files need to be
35 Such problems should always be reported upstream first.
37 Unfortunately, upstream can take a long time to act, and meanwhile the problem
38 metadata will appear in font lists and confuse applications. Since fixing font
39 files downstream is unpalatable when they are not released as fontforge SFD
40 files (otherwise, just patch the sfds and re-generate), using fontconfig to
41 hide the breakage is very convenient.
43 If you have different needs, take a look at the other templates.
45 Please replace [problemfontname], [problemfontstyle], [correctedfontname],
46 [correctedfontstyle], [genericname], with the
47 appropriate values in the following blocks of instructions.
49 A [correctedfontname] example would be:
51 It's the name under which the font appears in GUI font drop-downs.
53 [correctedfontname] and [correctedfontstyle] values should aim to conform
54 strictly to the rules defined by Microsoft in its WWS fonts white-paper:
55 http://blogs.msdn.com/text/attachment/2249036.ashx
57 Adobe published an introduction to the WWS logic here:
58 http://blogs.adobe.com/typblography/typotechnica2007/Font%20names.pdf
60 Fontconfig generics ([genericname]) currently include:
67 Processing the resulting file through xmllint with the "format" flag is usually
69 $ xmllint --format -o [XX]-[fontname].conf [yourfile]
70 The output file will be named:
72 where [XX] should be a two-digit number corresponding to the font priority in
75 © 2009 Nicolas Mailhot <nim at fedoraproject dot org>