Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere is android reading the file fonts.xml to load fonts correctly?
    primarykey
    data
    text
    <p>I been looking for this many days now.</p> <p>My company's android device (manufactured by us) uses Android 2.1. We need to support Arabic for one of our customers. We were able to get a third party software to join Arabic correctly and bought a font from another third party to display Arabic in 2.1.</p> <p>Android 2.1 has a file called fonts.xml that specifies when a font is to be used including fallback fonts. </p> <p>I want to know what component in the code reads the fonts.xml file (currently located in /frameworks/base/data/fonts) so that I can change this file to another location and change it dynamically per customer without having to rebuild a new image of the system each time.</p> <p>Thank you!</p> <p>UPDATE:</p> <p>Doing a search of fonts.xml I found sdk.atree contains the following lines:</p> <pre><code># fonts for 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 </code></pre> <p>However, I do not see the files fonts.xm and DroidSansJapanese.ttf in my /system/fonts/</p> <p>I suggested to my work to rename the Arabic font to DroidSansJapanese.ttf so that the system will read it, but this will cause confusion for sure in the future.</p> <p>I also tried manually putting a modified fonts.xml in the /sytem/fonts and rebooting the device, but did not work.</p> <p>Also, FontLoader.java loads fonts.xml but it does not specify the whole path as it gets passed by Bridge.java. Bridge.java also gets passed the full path. the variable used is String fontOsLocation. Its named like this in both classes, so I did a search but found nothing specifying the exact location in the source:</p> <pre><code>public static FontLoader create(String fontOsLocation) {} </code></pre> <p>My last option would be to try re-write FontLoader so even if it takes a string for the fontOsLocation, I just give it a hardcoded path that comes from the SD card. But I don't know what effect this might have on the system. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload