From 721f6792b43a251075a381c521972b9e8ec4b84e Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Mon, 8 Oct 2018 17:04:54 -0700 Subject: Use a host java program to generate the background text 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. The program takes the following 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. Bug: 74397117 Test: checks the generated png files Change-Id: Ia5506a0a4f5da1ebfd7090345eb246f44b265075 --- tools/image_generator/Android.bp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/image_generator/Android.bp (limited to 'tools/image_generator/Android.bp') diff --git a/tools/image_generator/Android.bp b/tools/image_generator/Android.bp new file mode 100644 index 000000000..3f718fec5 --- /dev/null +++ b/tools/image_generator/Android.bp @@ -0,0 +1,23 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +java_library_host { + name: "RecoveryImageGenerator", + + manifest: "ImageGenerator.mf", + + srcs: [ + "ImageGenerator.java", + ], +} \ No newline at end of file -- cgit v1.2.3