e105751292
Revert "Rename font file with PostScript based names" Revert submission 1606485-rename_fonts Reason for revert: font file name requirement was removed. Reverted Changes: Iab8b9d65a:Update ImageGenerator to match the latest font nam... Ifbe99d68c:Rename the font file with PostScript name based fi... I307c21531:Rename font file with PostScript based names Change-Id: Ic8174b4a4a736d9079dee4106bdfa5c440f877bb Merged-In: I4499dafa3bb3bfcbb8a97dcfd5b4593db467fbd3 |
||
---|---|---|
.. | ||
Android.bp | ||
ImageGenerator.java | ||
ImageGenerator.mf | ||
README.md |
Recovery Image Generator
This program uses java.awt.Graphics2D to generate the background text files used under recovery mode. And thus we don't need to do the manual work by running emulators with different dpi.
Usage:
java -jar path_to_jar --image_width imageWidth --text_name textName --font_dir fontDirectory --resource_dir resourceDirectory --output_file outputFilename
Description of the parameters:
imageWidth
: The number of pixels per line; and the text strings will be wrapped accordingly.textName
: The description of the text string, e.g. "recovery_erasing", "recovery_installing_security"fontDirectory
: The directory that contains all the support .ttf | .ttc files, e.g. $OUT/system/fonts/resourceDirectory
: The resource directory that contains all the translated strings in xml format, e.g. bootable/recovery/tools/recovery_l10n/res/outputFilename
: Path to the generated image.
Locales
Supported locales and background texts are located in tools/recovery_l10n/res/. For each background text, the tool renders a localized image for every supported locale.
Each individual localized image contains an encoded locale header string, and the rendered
background text. The locale header string is generated by Locale.forLanguageTag
. And sample
result include en-US
, zh-CN
, etc. These individual images are then concatenated together to
form the final resource image that locates in res/images, e.g. install_text.png