Font Glyph width problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Font Glyph width problem

picoworm
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.

Here is the link to my code:
https://github.com/picoworm/TextRenderUtil_test
Reply | Threaded
Open this post in threaded view
|

Re: Font Glyph width problem

Sven Gothel
Administrator
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
Reply | Threaded
Open this post in threaded view
|

Re: Font Glyph width problem

picoworm
I have posted 2 more issues to bugzilla, that touches font rendering.

Please look when you will have a free time.
Reply | Threaded
Open this post in threaded view
|

Re: Font Glyph width problem

Sven Gothel
Administrator
On 09/04/2014 07:13 PM, picoworm [via jogamp] wrote:
> I have posted 2 more issues to bugzilla, that touches font rendering.
>
> Please look when you will have a free time.

I saw that - THANK YOU

I also added a prelim test to test those issues,
already in our git repo.

After 2.2.1 I will find time tackling it.

~Sven



signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Font Glyph width problem

picoworm
Thank you.
I'll look forward to the new version.

Can I ask you about another expansion?

In my program I need to draw text in a non-zero Framebuffer.
And when I use the renderer without anti-alias, then all is well.

But if I draw with antialiasing, library always draws to the back buffer.

Would be great if the new versions will be able to select the buffer in which you want to draw.

Best regards,
Roman
Reply | Threaded
Open this post in threaded view
|

Re: Font Glyph width problem

Sven Gothel
Administrator
On 09/04/2014 08:56 PM, picoworm [via jogamp] wrote:

> Thank you.
> I'll look forward to the new version.
>
> Can I ask you about another expansion?
>
> In my program I need to draw text in a non-zero Framebuffer.
> And when I use the renderer without anti-alias, then all is well.
>
> But if I draw with antialiasing, library always draws to the back buffer.
>
> Would be great if the new versions will be able to select the buffer in which
> you want to draw.
Pls file this under another bug report, so it won't get lost - thx.

~Sven



signature.asc (828 bytes) Download Attachment