EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: rizlesz2000 on October 23, 2023, 12:40:28 pm

Title: How can I apply custom fonts in u8g2 library
Post by: rizlesz2000 on October 23, 2023, 12:40:28 pm
I read that I need to do set font command but in this case I only need one custom font. So I converted my ttf file to bdf which is supported by u8g2. The thing is that I wanted to add the setfont command on the beginning and rest of the place should be the scalling of the font and don't want to use separate font files for different sizes. I meant that, the smaller font is 8px which is default and othe size should be multiples of 8 which double the size (double the pixel size) . Any ideas? Thanks
Title: Re: How can I apply custom fonts in u8g2 library
Post by: coromonadalix on October 23, 2023, 02:03:04 pm
https://forum.arduino.cc/t/u8g2-custom-font-tutorial-with-fony/686061
Title: Re: How can I apply custom fonts in u8g2 library
Post by: rizlesz2000 on October 23, 2023, 02:39:06 pm
OK, but how do I scale the font in the program
Title: Re: How can I apply custom fonts in u8g2 library
Post by: DavidAlfa on October 23, 2023, 02:53:55 pm
You can't, you must make the font for a specific size.
Read the u8g2 wiki!