diff --git a/FONT_CONVERSION.md b/FONT_CONVERSION.md new file mode 100644 index 00000000..327f0635 --- /dev/null +++ b/FONT_CONVERSION.md @@ -0,0 +1,37 @@ +# 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-py` library (`pip install freetype-py`) + +## Usage + +Run the script from the project root: + +```bash +python3 lib/EpdFont/scripts/fontconvert.py --binary [Family-Style-Size] [Size] [PathToFont] +``` + +### Arguments +1. `name`: The output filename (without extension). **Convention:** `Family-Style-Size` (e.g. `Bookerly-Regular-12`). +2. `size`: The integer point size (e.g. `12`). +3. `fontstack`: Path to the source font file (e.g. `fonts/Bookerly-Regular.ttf`). +4. `--binary`: **REQUIRED**. Flags the script to output the `.epdfont` binary instead of a C header. + +### Example + +To convert `Bookerly-Regular.ttf` to a size 12 font: + +```bash +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 +1. Rename the file if necessary to match the pattern: `Family-Style-Size.epdfont`. +2. Copy the `.epdfont` file to the `/fonts` directory on your SD card. diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 0c852691..615a5c20 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -128,6 +128,12 @@ You can customize the sleep screen by placing custom images in specific location > - Use uncompressed BMP files with 24-bit color depth > - Use a resolution of 480x800 pixels to match the device's screen resolution. +### 3.7 Custom Fonts + +You can load your own custom fonts onto the device by converting them to the required `.epdfont` format. + +See the **[Font Conversion Guide](FONT_CONVERSION.md)** for detailed instructions on how to use the conversion tool. + --- ## 4. Reading Mode