vendor_fonts.xml revision 7b0b897c548eab1bfd0e53da96582bb154ac87e3
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3    Vendor-provided fallback fonts
4
5    This file can be edited to add references to fonts that are not installed or referenced in the
6    default system. The file should then be placed in /vendor/etc/fallback_fonts.xml. Note
7    that in your makefile, this directory should be referenced as $(TARGET_COPY_OUT_VENDOR)/etc/:
8
9        PRODUCT_COPY_FILES += \
10            frameworks/base/data/fonts/vendor_fonts.xml:$(TARGET_COPY_OUT_VENDOR)/etc/fallback_fonts.xml \
11            frameworks/base/data/fonts/vendor_fonts-ja.xml:$(TARGET_COPY_OUT_VENDOR)/etc/fallback_fonts-ja.xml
12
13    For example, vendors might want to build configurations for locales that are
14    better served by fonts which either handle glyphs not supported in the default fonts or which
15    handle these glyphs differently than the default fallback fonts.
16    Each entry in this list is a "family", which consists of a list of "files"
17    (the filenames for that family). The files objects are
18    provided in the order of the styles supported for that family: regular, bold, italic, and
19    bold-italic. Only providing one font means that all styles will be rendered with that font.
20    Providing two means that these two fonts will render regular and bold fonts (italics will
21    be mapped to these two fonts).
22
23    There is also an optional "order" attribute on the Family tag. This specifies the index at
24    which that family of fonts should be inserted in the fallback font list, where the
25    default fallback fonts on the system (in /system/etc/fallback_fonts.xml) start at index 0.
26    If no 'order' attribute is supplied, that family will be inserted either at the end of the
27    current fallback list (if no order was supplied for any previous family in this file) or
28    after the previous family (if there was an order specified previously). Typically, vendors
29    may want to supply an order for the first family that puts this set of fonts at the appropriate
30    place in the overall fallback fonts. The order of this list determines which fallback font
31    will be used to support any glyphs that are not handled by the default system fonts.
32
33    Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters;
34    their ordering in the fallback or vendor files gives priority to the first in the list.
35    Locale-specific ordering can be configured by adding language and region codes to the end
36    of the filename (e.g. /vendor/etc/fallback_fonts-ja.xml). When no region code is used,
37    as with this example, all regions are matched. Use separate files for each supported locale.
38    The standard fallback file (fallback_fonts.xml) is used when a locale does not have its own
39    file. All fallback files must contain the same complete set of fonts; only their ordering
40    can differ. For example, on a device supporting Japanese, but with English as the default,
41    /vendor/etc/fallback_fonts.xml might contain:
42
43        <familyset>
44            <family>
45                <fileset>
46                    <file>DroidSansJapanese.ttf</file>
47                </fileset>
48            </family>
49        </familyset>
50
51    placing the Japanese font at the end of the fallback sequence for English, with a corresponding
52    /system/vendor/etc/fallback_fonts-ja.xml, placing it at the front of the list.
53
54        <familyset>
55            <family order="0">
56                <fileset>
57                    <file>DroidSansJapanese.ttf</file>
58                </fileset>
59            </family>
60        </familyset>
61
62    The sample configuration below is an example of how one might provide two families of fonts
63    that get inserted at the first and second (0  and 1) position in the overall fallback fonts.
64
65    See /system/etc/system_fonts.xml and /system/etc/fallback_fonts.xml for more information
66    and to understand the order in which the default system fonts are loaded and structured for
67    lookup.
68-->
69
70<!-- Sample fallback font additions to the default fallback list. These fonts will be added
71    to the top two positions of the fallback list, since the first has an order of 0. -->
72<!--
73<familyset>
74    <family order="0">
75        <fileset>
76            <file>MyFont.ttf</file>
77        </fileset>
78    </family>
79    <family>
80        <fileset>
81            <file>MyOtherFont.ttf</file>
82        </fileset>
83    </family>
84</familyset>
85-->