Jump to content
  • Advertisement
Sign in to follow this  
eagerone

font rendering

This topic is 2909 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

Hello

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 :] )
http://poznavalec.evil.si/layout.png

and a more compressed example
http://dmedia.dprogramming.com/uploads/Tutorials/textTut_fontTexture.png

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

cheers

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!