Skip to content

Commit b7b3894

Browse files
Russell BrennerAndroid (Google) Code Review
authored andcommitted
Merge "Improved comments for vendor fonts xml"
2 parents 2c4eabc + 7b0b897 commit b7b3894

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

data/fonts/vendor_fonts.xml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
Vendor-provided fallback fonts
44
55
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.
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
712
813
For example, vendors might want to build configurations for locales that are
914
better served by fonts which either handle glyphs not supported in the default fonts or which
@@ -28,11 +33,31 @@
2833
Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters;
2934
their ordering in the fallback or vendor files gives priority to the first in the list.
3035
Locale-specific ordering can be configured by adding language and region codes to the end
31-
of the filename (e.g. /system/etc/fallback_fonts-ja.xml). When no region code is used,
36+
of the filename (e.g. /vendor/etc/fallback_fonts-ja.xml). When no region code is used,
3237
as with this example, all regions are matched. Use separate files for each supported locale.
3338
The standard fallback file (fallback_fonts.xml) is used when a locale does not have its own
3439
file. All fallback files must contain the same complete set of fonts; only their ordering
35-
can differ.
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>
3661
3762
The sample configuration below is an example of how one might provide two families of fonts
3863
that get inserted at the first and second (0 and 1) position in the overall fallback fonts.

0 commit comments

Comments
 (0)