Re: Font Glyph width problem

Posted by Sven Gothel on
URL: https://forum.jogamp.org/Font-Glyph-width-problem-tp4032673p4032831.html

On 07/29/2014 01:57 PM, picoworm [via jogamp] wrote:

> Hi everyone,
>
> Working with latest jogl-2.2-b1103-20140709 windows amd64 I had next problem:
>
> Two functions:
> First:
>                 System.out.println(font.getGlyph(' ').getAdvance(fontSize,
> true));
> Second:
>                 System.out.println(font.getAdvanceWidth(Glyph.ID_SPACE,
> fontSize));
>
> Prints me a different result:
> First: 75.0
> Second: 27.783203
>
> Both of them must return the size of space character.
> But the real problem is this 2 functions is used inside jogl to determine width.
> First function is used in font.getMetricBounds function to get size of string.
> And second one is used in drawString3D, to render the string
>
> When I tried to put string with space character inside a rectangle, I cannot
> do it.
Verified - analyzing it.

Thx!

~Sven



signature.asc (828 bytes) Download Attachment