Folks, I have been using a portion of the TWL Theme Editor to render true type fonts into a texture buffer for use in a custom application where I need access to the raw font bitmap data. There are 3 techniques exposed by Mattias' api for rendering fonts (Free Type 2, Vector and Draw String) (the latter 2 are very similar as they go through AWT). The problem I encountered is that the raw data in the texture image appears to be 1 pixel oversized for Draw String and Vector rendering, while it is correctly sized when using the native Free Type 2 rendering.
I had to add lots of workaround code in my application that calls the de.matthiasmann.twlthemeeditor.fontgen.FontGenerator in order to work around this issue (basically I need a flag indicating whether the rendered GlyphRects x,y,width,height are oversized or not in order to extract the pixels corectly without a blank column or line on the left and top respectively, I was wondering if anyone else has encountered this problem. Ideally a workaround in the FontGenerator would be ideal for this to return consistent glyph rects.
John
|