Author Topic: How can I apply custom fonts in u8g2 library  (Read 1002 times)

0 Members and 1 Guest are viewing this topic.

Offline rizlesz2000Topic starter

  • Contributor
  • Posts: 12
  • Country: in
How can I apply custom fonts in u8g2 library
« 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
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 6626
  • Country: ca
 

Offline rizlesz2000Topic starter

  • Contributor
  • Posts: 12
  • Country: in
Re: How can I apply custom fonts in u8g2 library
« Reply #2 on: October 23, 2023, 02:39:06 pm »
OK, but how do I scale the font in the program
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6247
  • Country: es
Re: How can I apply custom fonts in u8g2 library
« Reply #3 on: October 23, 2023, 02:53:55 pm »
You can't, you must make the font for a specific size.
Read the u8g2 wiki!
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf