Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

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

closed-fixed
Sam Hocevar
None
5
2010-05-22
2009-07-27
Simone Contini
No

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.

Discussion

  • Simone Contini
    Simone Contini
    2009-07-27

    test case

     
    Attachments
  • 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