mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 07:07:38 +03:00
1.3 KiB
1.3 KiB
Font Conversion Guide
To use custom fonts with the CrossPoint Reader, you must convert standard .ttf or .otf font files into the specific .epdfont binary format used by the compiled firmware.
We use a Python script located at lib/EpdFont/scripts/fontconvert.py.
Requirements
- Python 3
freetype-pylibrary (pip install freetype-py)
Usage
Run the script from the project root:
python3 lib/EpdFont/scripts/fontconvert.py --binary [Family-Style-Size] [Size] [PathToFont]
Arguments
name: The output filename (without extension). Convention:Family-Style-Size(e.g.Bookerly-Regular-12).size: The integer point size (e.g.12).fontstack: Path to the source font file (e.g.fonts/Bookerly-Regular.ttf).--binary: REQUIRED. Flags the script to output the.epdfontbinary instead of a C header.
Example
To convert Bookerly-Regular.ttf to a size 12 font:
python3 lib/EpdFont/scripts/fontconvert.py --binary Bookerly-Regular-12 12 fonts/Bookerly-Regular.ttf
This will generate Bookerly-Regular-12.epdfont in your current directory.
Installing on Device
- Rename the file if necessary to match the pattern:
Family-Style-Size.epdfont. - Copy the
.epdfontfile to the/fontsdirectory on your SD card.