Python utility to help create a custom language pack file for the Pebble watch (.pbl). Generates the required source files from a custom input list of display characters, which can include multiple languages and font files, and packages them into an import-ready language pack.
The script will perform 2 scans. Edit the files in the lang/ directory to configure the character set to import. Place the TTF font files to build from into the ttf/ directory. Place the PBFF font files to build from into the pbff/ directory.
1.1 (Easy way) If the character set you want to add is small, locate the Unicode block of the character set you wish to add and edit the lang/unicodes.json by following the existing template. Remove any default character set you do not need. The name property is only for reference. The start and end properties are the start and end address in Base 16 of the Unicode character range to be imported. Specify the font file to import from with the ttf (full name, like example.ttf) or pbff (only folder name, like renaissance) property. Leave an empty array if you do not use this file.
1.2 If the character set you want to add would be too large to import in full, identify the subset of those characters that you want to import and input them into text files. The script will scan the lang/ directory for all *.txt files and import every characters that appear. Lines that start with # are ignored. The characters can be a long continuous string or separated by new-lines. Specify the font file to import from with a #ttf: (full name, like example.ttf) or #pbff: (only folder name, like renaissance) comment, which must precede the first non-comment line. The provided lang/kanji.txt is an example of the 3000 most used Kanji based on scriptin/aozora dataset.
The translation/000 holds the meta data and interface translation data. If you do not need to modify these, you can skip this step and use the default file.
2.1 translation/000.po file provides a template to start. The first few lines are the meta data. If you don't need to translate the interface, delete the rest of the msgid ... msgstr ... that follows.
2.2 For interface translation, replace all msgstr lines with the desired translation.
2.3 Build the 000.po file into a 000 file (MO format) using GNU msgfmt utility then replace the existing translation/000 with the built file.
The final language pack will be output to build/langpack.pbl. Example includes Japanese and Thai display character support added to the main English interface (EN_JP_TH.pbl).
Optionally, you can preview the generated font files in Pebble SDK's emulator before sending the generated Language Pack to your phone and watch.
- Noto Universal font -- https://github.com/satbyy/go-noto-universal
fontgen.py-- https://gist.github.com/medicalwei/c9fdcd9ec19b0c363ec1pbpack.pyandstm32_crc.py-- Couldn't locate source, but likely Pebble SDK- Kanji frequency list -- https://scriptin.github.io/kanji-frequency
- Renaissance -- https://github.com/pebble-dev/renaissance
- PBFF Format description -- https://github.com/pebble-dev/renaissance/wiki/PBFF-Format-description