font rendering

Started by
1 comment, last by eagerone 13 years, 9 months ago
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]
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?

Omae Wa Mou Shindeiru

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]

This topic is closed to new replies.

Advertisement