Add Persian to Android 4.0.4

Source: Internet
Author: User
Tags comparison table

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 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.