2.7 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.
Supported Formats
The CrossPoint Reader supports two versions of the .epdfont format:
- Version 1 (Recommended): The newer, optimized format generated by the web converter.
- Version 0 (Legacy): The original format generated by the Python script.
Method 1: Web Converter (Recommended)
The easiest way to generate compatible fonts is using the online converter.
- Go to https://epdfont.clev.app/.
- Select your
.ttfor.otffile. - Choose the font size (e.g., 18).
- Download the generated
.epdfontfile.
Filename Requirements
The firmware scans for fonts in the /fonts directory on the SD card. It attempts to parse the filename to determine the Font Family, Style, and Size.
For best results, rename your downloaded file to match one of these patterns:
Family_Style_Size.epdfont(e.g.,Aileron_Regular_18.epdfont)Family-Style-Size.epdfont(e.g.,LibreBaskerville-Bold-14.epdfont)
Supported Styles:
RegularBoldItalicBoldItalic
Note: If you download a file named just Aileron.epdfont, the reader will try to load it, but using the explicit naming convention above ensures the correct style and size are recognized.
Method 2: Python Script (Improved)
You can also use the included Python script located at lib/EpdFont/scripts/fontconvert.py. This script has been recently updated to ensure high-precision metric calculations (fixing issues with spacing and em-dashes).
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
- Copy your generated
.epdfontfiles to the/fontsdirectory on your SD card. - Restart the CrossPoint Reader.
- Go to Settings -> Set Custom Font Family to select your loaded fonts.