summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/fonts/vendor_fonts.xml31
1 files changed, 28 insertions, 3 deletions
diff --git a/data/fonts/vendor_fonts.xml b/data/fonts/vendor_fonts.xml
index c1116d0..5850f94 100644
--- a/data/fonts/vendor_fonts.xml
+++ b/data/fonts/vendor_fonts.xml
@@ -3,7 +3,12 @@
Vendor-provided fallback fonts
This file can be edited to add references to fonts that are not installed or referenced in the
- default system. The file should then be placed in /vendor/etc/fallback_fonts.xml.
+ default system. The file should then be placed in /vendor/etc/fallback_fonts.xml. Note
+ that in your makefile, this directory should be referenced as $(TARGET_COPY_OUT_VENDOR)/etc/:
+
+ PRODUCT_COPY_FILES += \
+ frameworks/base/data/fonts/vendor_fonts.xml:$(TARGET_COPY_OUT_VENDOR)/etc/fallback_fonts.xml \
+ frameworks/base/data/fonts/vendor_fonts-ja.xml:$(TARGET_COPY_OUT_VENDOR)/etc/fallback_fonts-ja.xml
For example, vendors might want to build configurations for locales that are
better served by fonts which either handle glyphs not supported in the default fonts or which
@@ -28,11 +33,31 @@
Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters;
their ordering in the fallback or vendor files gives priority to the first in the list.
Locale-specific ordering can be configured by adding language and region codes to the end
- of the filename (e.g. /system/etc/fallback_fonts-ja.xml). When no region code is used,
+ of the filename (e.g. /vendor/etc/fallback_fonts-ja.xml). When no region code is used,
as with this example, all regions are matched. Use separate files for each supported locale.
The standard fallback file (fallback_fonts.xml) is used when a locale does not have its own
file. All fallback files must contain the same complete set of fonts; only their ordering
- can differ.
+ can differ. For example, on a device supporting Japanese, but with English as the default,
+ /vendor/etc/fallback_fonts.xml might contain:
+
+ <familyset>
+ <family>
+ <fileset>
+ <file>DroidSansJapanese.ttf</file>
+ </fileset>
+ </family>
+ </familyset>
+
+ placing the Japanese font at the end of the fallback sequence for English, with a corresponding
+ /system/vendor/etc/fallback_fonts-ja.xml, placing it at the front of the list.
+
+ <familyset>
+ <family order="0">
+ <fileset>
+ <file>DroidSansJapanese.ttf</file>
+ </fileset>
+ </family>
+ </familyset>
The sample configuration below is an example of how one might provide two families of fonts
that get inserted at the first and second (0 and 1) position in the overall fallback fonts.