SourceForge has been redesigned. Learn more.

#18 hidden characters with some face/size on some video cards


I'm using FTGL 2.1.2 (fedora 11 package ftgl-2.1.2-10.fc11)

I noticed that using some face at some size I don't get the full string rendered on some video cards. For example: using Bitstream Vera Sans Roman 14 on some nvidia 7300 works but fails on 9400 models. If I write "jfoojbar" I see " foo bar". I'm using OpenGL rendering with FTGLTextureFont..

In my test case I found that in FTTextureGlyph::FTTextureGlyph glTexSubImage2D fails form the 'j' letter (I got an OpenGL error because yOffest + destHeight is more than the texture heigth! (I think that there are something internal difference between 7300 and 9400 so the first show the character anyway).

FTGLTextureFont::MakeGlyph initialize yOffest to padding, but FTGLTextureFont::CalculateTextureSize doesn't take enough room for the texture height. I attached a patch to quickly fix this problem using the same way to add the padding space that you are using for texture width.

I think that my patch isn't the right way: with this fix we'll waste a lot of video memory. I'll try to remove vertical padding from texture and work on translation between lines. I also noticed that next versions will have a simple layout management so I'll work for a better fix on the trunk version.


  • Simone Contini

    Simone Contini - 2009-07-27

    test case

  • Sam Hocevar

    Sam Hocevar - 2010-05-22

    I don't think that much texture memory is wasted. The texture size is rounded up to the nearest power of two anyway.

    I applied a fix based on your patch in trunk.

  • Sam Hocevar

    Sam Hocevar - 2010-05-22
    • assigned_to: nobody --> sammy
    • status: open --> closed-fixed

Log in to post a comment.