platform_bootable_recovery/tools/image_generator
Tianjie Xu 08b3146aa2 Merge "Add doc for image_generator" am: 40d4bc9e19 am: 0e46691951 am: cca4528dac
Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/1534220

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5423f90d72c799fde8320ffcbfcc56bf6b70c1f5
2020-12-29 00:46:10 +00:00
..
Android.bp Use icu4j instead of its deprecated legacy alias icu4j-host 2019-06-03 16:14:35 +01:00
ImageGenerator.java Update Indic scripts 2020-12-14 02:44:28 +00:00
ImageGenerator.mf Use a host java program to generate the background text 2018-10-12 15:46:32 -07:00
README.md Add doc for image_generator 2020-12-20 20:00:30 -08:00

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:

  1. imageWidth: The number of pixels per line; and the text strings will be wrapped accordingly.
  2. textName: The description of the text string, e.g. "recovery_erasing", "recovery_installing_security"
  3. fontDirectory: The directory that contains all the support .ttf | .ttc files, e.g. $OUT/system/fonts/
  4. resourceDirectory: The resource directory that contains all the translated strings in xml format, e.g. bootable/recovery/tools/recovery_l10n/res/
  5. 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