Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitmap font (pcf and/or bdf format) #114

Open
razor5k opened this issue Jun 6, 2024 · 5 comments
Open

Bitmap font (pcf and/or bdf format) #114

razor5k opened this issue Jun 6, 2024 · 5 comments

Comments

@razor5k
Copy link

razor5k commented Jun 6, 2024

Hi,
I've a display which has a resolution of 256x64 Pixel (SSD1322 controller) and I need also small font sizes (8px and so on).
But every rendered font don't look very pretty. Is it possible to edit a font after rendering (with a font editor tool from lvgl or something) or can I use bitmap fonts such as pcf or bdf format?
Does lv_font_conv handle bitmap information embedded in ttf or otf etc? If I disable autohinting, the font seems to look better but I thought hinting should make the font better look.

@kisvegabor
Copy link
Member

Unfortunately there is no easy way to edit the generated fonts.

For monochrome displays I think the best you can do is selecting a pixel font. The Terminus font might be a good first candidate.

Alternatively you can try Image font.

@razor5k
Copy link
Author

razor5k commented Jun 11, 2024

Thx. I tested Terminus and it looks very pretty. It's a mono space font and it looks very 'sharp'. I also found a way to "convert" a bdf to a ttf. Binary information of the bdf files will be embedded to a single ttf file by using 'mkttf'. It uses fontforge, imagemagick and potrace. Now I'm able to use every bdf font. It would be nice if lvgl_font_converter could use the bdf format as well. Because the pixel information is directly available, no complicated rendering would be necessary. But mkttf works for me as well :)

@kisvegabor
Copy link
Member

The font converter uses FreeType, so we can use the font types supported by FreeType.

Would you be interested in documenting the process of bdf to ttf conversation? If so I think a section after this would be quite useful for others. (You need to edit this file to update the docs)

@razor5k
Copy link
Author

razor5k commented Jun 14, 2024

Yes, I will document the use of the BDF files in the next few days.

@kisvegabor
Copy link
Member

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants