Where is android reading the file fonts.xml to load fonts correctly? -
i been looking many days now.
my company's android device (manufactured us) uses android 2.1. need support arabic 1 of our customers. able third party software join arabic correctly , bought font third party display arabic in 2.1.
android 2.1 has file called fonts.xml specifies when font used including fallback fonts.
i want know component in code reads fonts.xml file (currently located in /frameworks/base/data/fonts) can change file location , change dynamically per customer without having rebuild new image of system each time.
thank you!
update:
doing search of fonts.xml found sdk.atree contains following lines:
# fonts layoutlib. frameworks/base/data/fonts/fonts.xml platforms/${platform_name}/data/fonts/fonts.xml frameworks/base/data/fonts/droidsans.ttf platforms/${platform_name}/data/fonts/droidsans.ttf frameworks/base/data/fonts/droidsans-bold.ttf platforms/${platform_name}/data/fonts/droidsans-bold.ttf frameworks/base/data/fonts/droidsansmono.ttf platforms/${platform_name}/data/fonts/droidsansmono.ttf frameworks/base/data/fonts/droidserif-bold.ttf platforms/${platform_name}/data/fonts/droidserif-bold.ttf frameworks/base/data/fonts/droidserif-bolditalic.ttf platforms/${platform_name}/data/fonts/droidserif-bolditalic.ttf frameworks/base/data/fonts/droidserif-italic.ttf platforms/${platform_name}/data/fonts/droidserif-italic.ttf frameworks/base/data/fonts/droidserif-regular.ttf platforms/${platform_name}/data/fonts/droidserif-regular.ttf frameworks/base/data/fonts/droidsansfallback.ttf platforms/${platform_name}/data/fonts/droidsansfallback.ttf frameworks/base/data/fonts/droidsansjapanese.ttf platforms/${platform_name}/data/fonts/droidsansjapanese.ttf however, not see files fonts.xm , droidsansjapanese.ttf in /system/fonts/
i suggested work rename arabic font droidsansjapanese.ttf system read it, cause confusion sure in future.
i tried manually putting modified fonts.xml in /sytem/fonts , rebooting device, did not work.
also, fontloader.java loads fonts.xml not specify whole path gets passed bridge.java. bridge.java gets passed full path. variable used string fontoslocation. named in both classes, did search found nothing specifying exact location in source:
public static fontloader create(string fontoslocation) {} my last option try re-write fontloader if takes string fontoslocation, give hardcoded path comes sd card. don't know effect might have on system. thank you.
ok, found 1 solution. running problem, here goes:
external/skia/src/ports/skfonthost_android.cpp -> specified .ttf files used style
and font files need added to:
frameworks/base/data/fonts/ -> here .ttf files
and android.mk inside frameworks/base/data/fonts/ folder needs modified new font files copied folder /system/fonts
hope helps someone.
Comments
Post a Comment