blob: 8690ee1af5c768ce4d07408caac52aba546f07cb [file] [log] [blame]
Chet Haasec8f060c2011-07-06 11:17:26 -07001<?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
Russell Brenner7b0b8972012-03-21 13:29:54 -07006 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 += \
Billy Hewlett88455fa2012-07-18 09:51:45 -070010 frameworks/base/data/fonts/vendor_fonts.xml:$(TARGET_COPY_OUT_VENDOR)/etc/fallback_fonts.xml
Chet Haasec8f060c2011-07-06 11:17:26 -070011
12 For example, vendors might want to build configurations for locales that are
13 better served by fonts which either handle glyphs not supported in the default fonts or which
14 handle these glyphs differently than the default fallback fonts.
15 Each entry in this list is a "family", which consists of a list of "files"
16 (the filenames for that family). The files objects are
17 provided in the order of the styles supported for that family: regular, bold, italic, and
18 bold-italic. Only providing one font means that all styles will be rendered with that font.
19 Providing two means that these two fonts will render regular and bold fonts (italics will
20 be mapped to these two fonts).
21
22 There is also an optional "order" attribute on the Family tag. This specifies the index at
23 which that family of fonts should be inserted in the fallback font list, where the
24 default fallback fonts on the system (in /system/etc/fallback_fonts.xml) start at index 0.
25 If no 'order' attribute is supplied, that family will be inserted either at the end of the
26 current fallback list (if no order was supplied for any previous family in this file) or
27 after the previous family (if there was an order specified previously). Typically, vendors
28 may want to supply an order for the first family that puts this set of fonts at the appropriate
29 place in the overall fallback fonts. The order of this list determines which fallback font
30 will be used to support any glyphs that are not handled by the default system fonts.
31
Russell Brenner2b4b35c2012-03-08 10:25:17 -080032 Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters;
33 their ordering in the fallback or vendor files gives priority to the first in the list.
Billy Hewlett88455fa2012-07-18 09:51:45 -070034 Language-specific ordering can be configured by adding a BCP 47-style "lang" attribute to
35 a "file" element; fonts matching the language of text being drawn will be prioritised over
36 all others.
Russell Brenner2b4b35c2012-03-08 10:25:17 -080037
Chet Haasec8f060c2011-07-06 11:17:26 -070038 The sample configuration below is an example of how one might provide two families of fonts
39 that get inserted at the first and second (0 and 1) position in the overall fallback fonts.
40
41 See /system/etc/system_fonts.xml and /system/etc/fallback_fonts.xml for more information
42 and to understand the order in which the default system fonts are loaded and structured for
43 lookup.
44-->
45
46<!-- Sample fallback font additions to the default fallback list. These fonts will be added
47 to the top two positions of the fallback list, since the first has an order of 0. -->
48<!--
49<familyset>
50 <family order="0">
51 <fileset>
52 <file>MyFont.ttf</file>
53 </fileset>
54 </family>
55 <family>
56 <fileset>
57 <file>MyOtherFont.ttf</file>
58 </fileset>
59 </family>
60</familyset>
Billy Hewlett88455fa2012-07-18 09:51:45 -070061--->