A tool for creating, verifying and fixing font packages used by Fontster.
Fontster works by replacing the twelve font styles used by the system. In the context of the app, these twelve styles can be referred to as a font pack. Building font packs isn't always as simple as gathering and renaming TrueType fonts. Each style must have the correct macStyle
. This is a property defined in the header table of the file which specifies whether the font is regular, italic, bold, or a combination of the three.
Adding a font to the Android system with an incorrect macStyle
will cause the device to bootloop, resulting in angry users. Litho prevents this from happening by verifying that fonts have correctly assigned macStyles
, and fixing the property in the case that it has been set incorrectly.
Visit the releases page and download the latest version.
- Place your fonts in a folder with a suitable name.
- All files must be .TTF and styles should be named exactly as shown here
Example usage for a folder named Helvetica
:
# Checks that each font has been assigned the correct macStyle
./litho verify Helvetica
# Assigns the correct macStyle to each font
./litho fix Helvetica
# Generates missing styles to build a full font package
./litho package Helvetica
This will create a folder named HelveticaFontPack
containing all twelve verified styles.
Litho also provides the ability to install generated font packages onto a device. This is done via ADB which allows for compatibility with physical devices and emulators (assuming they are rooted).
# Installs Helvetica onto a connected device
./litho install HelveticaFontPack
Copyright 2015 Priyesh Patel
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.