Jump to content

Fonts and storage


king2

Recommended Posts

Hello developers! :)

uGFX uses converted fonts. If user will use several sizes of same font in application, this approach requires much space in firmware, one for each size.

Did you tried to use direct embedding TTF to firmware? In some cases this can save space and make firmware size smaller, and will allow to use any font size!

I found gdispScaleFont in gdisp_fonts.c file. Can I use it to reduce space required for fonts if I need same font with different sizes?

Thanks!

Link to comment
Share on other sites

Yes you can use that call to cheaply do scaled fonts. Note it just uses integer scaling so you get the normal pixel doubling artifacts.

My experience is that doubling horizontally looks much better than doubling vertically. Note the UI1 and 2 fonts already have wide versions automatically included using this font scaling capability.

The reason we don't directly embed true type fonts are multiple..

  • true type fonts require special curve drawing routines that are complex (large amounts of code)
  • true type fonts are slow to draw
  • they require large amounts of ram (for an embedded platform)
  • they are generally bigger than our optimized fonts
  • there may be IP and patent issues with the true type format

Their only advantage is that they scale to multiple sizes easily.

For these reasons we currently don't support true type fonts directly. We may add support in future but they will always be secondary and optional because they just don't perform as well in an embedded project.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...