Generating fonts with EPDiy - martinberlin/epaper-weather-station GitHub Wiki

In order to make C font headers from TTF fonts, you need to use the python script located in the components folder

/components/epaper-parallel/epdiy/scripts

The example line to make a font:

python fontconvert.py name_of_C_variable size /path/to/font.ttf>/destination/filename.h

python fontconvert.py ubuntu_l_80 80 /usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf>/home/martin/esp/projects/epaper-weather-station/components/big-fonts/e_ubuntu_l_80.h

Be aware of the ASCII ranges because if you make BIG fonts then using a large range will end up using a lot of data RAM, which won't fit in your microchip memory. So it's wise for example to use only 0-9 and ":" characters for a font to display a clock instead of making the full ASCII table.

To edit the ranges, simply open the fontconvert.py and modify like explained there:

# inclusive unicode code point intervals
# must not overlap and be in ascending order
intervals = [
    # a-Z
    (32, 126),
    # Only 0-9 and :
    (48, 58), 
    # ° degree symbol: Does not work for me
    (247, 248)
    # punctuation
    #(0x2010, 0x205F),
]

Ubuntu Light 80 for the day of week and 120 bold generated for the hour:minutes

Ubuntu Light 80