Jump to content
  • Advertisement
Sign in to follow this  

font rendering

This topic is 3000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I want to optimise my font rendering.

Currently I am creating a texture (pov2) containing several font sizes (possibly several fonts) arranged on a matrix.

This approach allows me to calculate origins of a glyph, so all that is left to calculate in the layout engine is yoffset and advance + porhaps kering.

Another approach is more complicated, based on this article: http://dmedia.dprogramming.com/?n=Tutorials.TextRendering1

This way (or even if I simply dont use a constant width) I need to store glyph position in the texture, since it cant be callculated.

matrix example (ASCII+Latin extended A with control chars :] )

and a more compressed example

is saved memory a good enough reason to go into implementing the more complicated layout engine?


[Edited by - eagerone on July 7, 2010 10:05:27 AM]

Share this post

Link to post
Share on other sites
You need width metrics (and kerning pairs) as separate metadata in any case because not all glyphs have the same width: I don't think drawing completely arbitrary rectangles within the texture instead of partly computed ones would be more complicated.

What program do you use to create the texture?

Share this post

Link to post
Share on other sites
yeah it probably wouldnt. I would need two more floats per glyph and that is it. Going to implement it now. I'm storing the freetype glyph to use for kerning, that also gives me all other metadata I need.

That should answer your question; I'm generating the texture with my code using FreeType2 library. Can create my texture as I see fit :DDD

[Edited by - eagerone on July 7, 2010 10:58:19 AM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!