1. determine the language and country comparison table. The Persian comparison is as follows:
Fa_ir
2. Based on build \ target \ product \ SDK. mk
$ (Call inherit-product-if-exists, frameworks/base/data/fonts. mk) $ (call inherit-product-if-exists, frameworks/base/data/keyboards. mk) $ (call inherit-product, $ (src_target_dir)/product/core. mk) # overridesproduct_brand: = genericproduct_name: = sdkproduct_device: = generic # locale + densities. en_us is both first and in alphabetical order to # ensure this is the default locale. product_locales = \ en_us \ ldpi \ hdpi \ mdpi \ xhdpi \ ar_eg \ ar_il \
By $ (call inherit-product-if-exists, frameworks/base/data/fonts. mk), you can know the location of the language library to be added.
Add the downloaded droidsansarabic. TTF language library in the frameworks/base/data/fonts directory.
Modify fonts. mk and add a new copy path.
Product_copy_files: = \ frameworks/base/data/fonts/droidsansarabic. TTF: System/fonts/droidsansarabic. TTF \
Finally
Product_locales = \
Added support for Persian
Fa_ir
3 ndk uses different encoding tools than Java. ndk uses icu4c as the encoding tool, and the source code directory is external \ icu4c.
Support for Persian encoding is added to external \ icu4c \ stubdata \ Android. mk by default. Therefore, you do not need to modify the code. You need to modify the 2.3 system.
# Build configuration: # 'all' except des all ICU's locale data, but is currently missing some Android # extensions (mostly extra charset converters ). # 'default' (icudt46l-default.txt) Events des all the most-used locales, # covering 94% of Internet users # (http://googleblog.blogspot.com/2008/07/hitting-40-languages.html): # AR, BG, CA, Cs, da, de, el, en, es, fa, Fi, Fil, FR, He, hi, HR, Hu, In, # it, ja, Ko, LT, LV, Nb, NL, pl, PS, PT, RM, Ro, Ru, SK, SL, Sr, SV, Th, # TR, UK, Vi, Zh. config: = default
4 In external \ skia \ SRC \ ports \ skfonthost_simple.cpp, add
static const fontinitrec gsystemfonts [] ={{ "Arial. TTF ", gsansnames}, {" times. TTF ", gserifnames}, {" samplefont. TTF ", gsansnames}, {" droidsansarabic. TTF ", gsansnames},
5. Finally, the product in the devices directory. MK added support for Persian
product_locales: = fa_ir en_us zh_cn fr_fr es_es de_de ru_ru ko_kr