The Android font file is placed in: alps\frameworks\base\data\fonts
Which Droidsans.ttf is the default English font, DROIDSANS-BOLD.TTF is the default English bold font; DROIDSANSFALLBACK.TTF is the default Chinese font.
To add a set of third party Chinese font () for example.
Because Google provides the default Chinese font Droidsansfallback.ttf is not very comprehensive, so customers often need to increase the three-party Chinese font to support the display of characters, and the new set of fonts as the system's default Chinese font.
In two different situations:
First, do not need to retain the Google default Chinese font:
Rename the three-party font to DROIDSANSFALLBACK.TTF and copy it to the Alps\frameworks\base\data\fonts, replacing the original default Chinese font for the system. New project and download bin to cell phone.
second, there is a need to retain Google's default Chinese font, and on this basis to increase their need for the new font
different from code version:
-Prior to the ICS 4.0 version:
1 copy newfontfile.ttf file to Alps\frameworks\base\data\fonts
2 The font file into the compilation options:
To modify the Frameworks/base/data/fonts/android.mk file:
Copy Code code as follows:
Copy_from: = \
DROIDSANSMONO.TTF \
NEWFONTFILE.TTF \
......
3) Modify External/skia/src/ports/skfonthost_android.cpp file:
Copy Code code as follows:
Add the corresponding font family
static const char *gnewfontfilenames[] = {
"..." the NULL//omitted part is determined by the current system-supported font engine.
};
Add the following statement
{"Newfontfile.ttf", Gnewfontfilenames},
So even if the addition is complete.
-ICS 4.0 version:
1 copy the corresponding font file to the Frameworks/base/data/fonts
2) Add the font family of the new font file under Fallback_fonts.xml (frameworks/base/data/fonts):
Copy Code code as follows:
<family>
<fileset>
<file>NewFontFile.ttf</file>
</fileset>
</family>
3) Modify Font makefile:fonts.mk (frameworks/base/data/fonts)
Copy Code code as follows:
Product_copy_files: = \
......
FRAMEWORKS/BASE/DATA/FONTS/NEWFONTFILE.TTF:SYSTEM/FONTS/NEWFONTFILE.TTF \