Initial commit
[profile/ivi/fontpackages.git] / fontconfig-templates / merging-font-template.txt
1 ▶ Documentation for merging-font-template.conf
2
3 This advanced template makes it possible to merge several overlapping font
4 families and make them appear as one (the target font family) to applications.
5 It is composed of five rules:
6 — the first one changes the version of the target [fontname] family to an
7   arbitrary high value (here 2).
8 – the second one remaps the name of the font family we want to merge with it
9   ([mergedfontname]) to the target, and assigns it a lower number (here 1).
10   Therefore fontconfig will always try to resolve a request using [fontname]
11   files first, and only use [mergedfontname] files if [fontname] files are not
12   sufficient.
13 — the third one is similar to our substitution rule, and is used to alias back
14   [mergedfontname] to [fontname]. This is necessary to avoid breaking
15   documents that reference [mergedfontname] since it is now hidden by the
16   previous rule.
17 — the fourth one tells fontconfig it can use the font named [fontname] when an
18   application asks for the generic family [genericname].
19 — the fifth one tells fontconfig it can complete the font named [fontname] with
20   glyphs taken from fonts registered under [genericname].
21
22 It is possible to merge more than one family, you will only have to repeat the
23 second and third rules as many times as necessary. Be careful however to
24 strictly order the font versions to make sure fontconfig uses the right
25 priorities within the target font family.
26
27 The typical use-case are font families released as several font sets, one of
28 which being of good quality but of limited Unicode coverage, and the others
29 providing wider coverage at the expense of quality or variety of styles.
30 Famous examples are “Arial” vs “Arial Unicode”, “Droid Sans” vs “Droid Sans
31 Fallback” or “Droid Sans Japanese”. Another use-case are fonts in legacy
32 formats: because those formats limited greatly the number of glyphs that could
33 be put in a single file, it was common to split a logical font family in
34 several encoding-specific files (of course in that case it would be better if
35 someone just merged the files in a single OpenType font).
36
37 If you have different needs, take a look at the other templates. For example
38 changing the naming of a font without merging it with another is better done
39 using the remapping template.
40
41 Please replace [fontname], [mergedfontname], [genericname], with the
42 appropriate values in the following blocks of instructions.
43
44 A [fontname] example would be:
45 DejaVu Sans
46 It's the name under which the font appears in GUI font drop-downs.
47
48 Fontconfig generics ([genericname]) currently include:
49 — sans-serif
50 — serif
51 — monospace
52 — fantasy
53 – cursive
54
55 Processing the resulting file through xmllint with the "format" flag is usually
56 a good idea.
57 $ xmllint --format -o [XX]-[fontname].conf [yourfile]
58 The output file will be named:
59 [XX]-[fontname].conf
60 where [XX] should be a two-digit number corresponding to the font priority in
61 fontconfig.
62
63 © 2009 Nicolas Mailhot <nim at fedoraproject dot org>