atomic14 / diy-esp32-epub-reader

An ESP32 e-reader
MIT License
319 stars 43 forks source link

Font Size #90

Open in-fluxed opened 1 year ago

in-fluxed commented 1 year ago

How do you change the font size? I tried changing it in the generate_fonts.sh in the scripts folder. I changed it to 8 and re-uploaded it but everything seems to be the same. What am I doing wrong?

eg: python3 fontconvert.py regular_font 8 SourceSansPro-Regular.ttf OpenSans-Regular.ttf --two-color --compress > ../lib/Fonts/regular_font.h

cgreening commented 1 year ago

Hmm, very strange - the line height should be driven off the regular font.

virtual int get_line_height()
{
   return m_regular_font->advance_y;
}

There is a script you should run to generate the fonts (there are bold and italic that are required as well) - just edit it to change the font size:

https://github.com/atomic14/diy-esp32-epub-reader#fonts