2018-10-09 02:04:54 +02: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:
|
2018-10-23 21:40:14 +02:00
|
|
|
`java -jar path_to_jar --image_width imageWidth --text_name textName --font_dir fontDirectory
|
|
|
|
--resource_dir resourceDirectory --output_file outputFilename`
|
2018-10-09 02:04:54 +02:00
|
|
|
|
|
|
|
# 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.
|
2020-12-21 04:46:11 +01:00
|
|
|
|
|
|
|
# Locales
|
|
|
|
Supported locales and background texts are located in
|
|
|
|
[tools/recovery_l10n/res/](../recovery_l10n/res/values). 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`
|