|
3 | 3 | Vendor-provided fallback fonts |
4 | 4 |
|
5 | 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. |
| 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 |
7 | 12 |
|
8 | 13 | For example, vendors might want to build configurations for locales that are |
9 | 14 | better served by fonts which either handle glyphs not supported in the default fonts or which |
|
28 | 33 | Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters; |
29 | 34 | their ordering in the fallback or vendor files gives priority to the first in the list. |
30 | 35 | 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, |
32 | 37 | as with this example, all regions are matched. Use separate files for each supported locale. |
33 | 38 | The standard fallback file (fallback_fonts.xml) is used when a locale does not have its own |
34 | 39 | 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> |
36 | 61 |
|
37 | 62 | The sample configuration below is an example of how one might provide two families of fonts |
38 | 63 | that get inserted at the first and second (0 and 1) position in the overall fallback fonts. |
|
0 commit comments