Wrong descent in SDL_TTF?

I’m having problems with SDL_TTF and certain fonts - namely, that the bottom
part of some glyphs is cut. See font.jpg. This is a test app, but showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be fixed?

Thanks,
–Gabriel
-------------- next part --------------
A non-text attachment was scrubbed…
Name: font.jpg
Type: image/jpeg
Size: 8339 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090924/5af13e2a/attachment.jpg
-------------- next part --------------
A non-text attachment was scrubbed…
Name: font2.jpg
Type: image/jpeg
Size: 20373 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090924/5af13e2a/attachment-0001.jpg

I’m having problems with SDL_TTF and certain fonts - namely, that the bottom
part of some glyphs is cut. See font.jpg. This is a test app, but showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be fixed?

Thanks,
–Gabriel
-------------- next part --------------
A non-text attachment was scrubbed…
Name: font.jpg
Type: image/jpeg
Size: 8339 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090925/59653e26/attachment.jpg
-------------- next part --------------
A non-text attachment was scrubbed…
Name: font2.jpg
Type: image/jpeg
Size: 20373 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090925/59653e26/attachment-0001.jpg

Hi,

I’m having problems with SDL_TTF and certain fonts - namely, that the
bottom
part of some glyphs is cut. See font.jpg. This is a test app, but
showfont
included in SDL_TTF does the same.

There are a few tools in the freetype demo package, try the font with
them. ftview may be the first you want to try (read the help…).
Perhaps you can narrow down the problem to freetype or SDL_ttf.On Fri, 25 Sep 2009 11:51:00 -0300, Gabriel Gambetta wrote:


Christoph Nelles

E-Mail : @Christoph_Nelles
Jabber : eazrael at evilazrael.net ICQ : 78819723

PGP-Key : ID 0x424FB55B on subkeys.pgp.net
or http://evilazrael.net/pgp.txt

You can download the font here :
http://de.fontstock.net/downloads/FletcherGothicFLF.zip

I tested the font with Ubuntu, which if i remember correctly,
uses Freetype with the Patented Bytecode Interpreter,
it shows the letters correctly.

So the problems come either from the Free Bytecode Interpreter
or have to do with SDL_ttf, which is my guess.

I will continue testing.

Hello !

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be fixed?

It is a problem of SDL_ttf, not Freetype.
Freetype is able to correctly render the letters.

SDL_ttf is somehow calculating the height of the final surface
wrong. It is simply not big enough. As an experiment i replaced
the height parameter in every SDL_AllocSurface in SDL_ttf with height + 50
and voila, it shows the complete letter, look at the attached png.

CU
-------------- next part --------------
A non-text attachment was scrubbed…
Name: font.png
Type: image/png
Size: 1798 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20090926/d4740bcd/attachment.png

Man, this sounds familiar. I swear I remember something about a
descending character (‘j’) not showing up properly in Tux Paint.
Maybe when it was the last letter in the word…?

I can’t find anything about a workaround in Tux Paint’s docs,
so my guess is: whatever the problem was back then, it was fixed in
SDL_ttf or FreeType.

Ugh. I should hit the SDL archives…

-bill!On Sat, Sep 26, 2009 at 12:22:15AM +0200, Torsten Giebl wrote:

It is a problem of SDL_ttf, not Freetype.
Freetype is able to correctly render the letters.

Man, this sounds familiar.

Ugh. I should hit the SDL archives…

Ah-hah:

http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2006-May/055866.html

SDL_ttf 2.0.8 is now available!
...
* Fixed line spacing by using font ascender and descender

Seemed to be an application of this, if I’m reading SVN archives correctly
in my weary, caffiene-less state:

http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2006-January/053446.html

yawn Happy hunting,On Fri, Sep 25, 2009 at 05:26:04PM -0700, Bill Kendrick wrote:


-bill!
Sent from my computer

Yep, I can reproduce this here. Can you enter a bug in bugzilla.libsdl.org?

Thanks!On Fri, Sep 25, 2009 at 7:51 AM, Gabriel Gambetta wrote:

I’m having problems with SDL_TTF and certain fonts - namely, that the bottom
part of some glyphs is cut. See font.jpg. This is a test app, but showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be fixed?

Thanks,
–Gabriel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

This is fixed for the next SDL_ttf release, thanks!On Fri, Sep 25, 2009 at 7:51 AM, Gabriel Gambetta wrote:

I’m having problems with SDL_TTF and certain fonts - namely, that the bottom
part of some glyphs is cut. See font.jpg. This is a test app, but showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be fixed?

Thanks,
–Gabriel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

That did it. Thanks a lot!

–GabrielOn Sat, Sep 26, 2009 at 4:59 AM, Sam Lantinga wrote:

This is fixed for the next SDL_ttf release, thanks!

On Fri, Sep 25, 2009 at 7:51 AM, Gabriel Gambetta wrote:

I’m having problems with SDL_TTF and certain fonts - namely, that the
bottom
part of some glyphs is cut. See font.jpg. This is a test app, but
showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says
WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be
fixed?

Thanks,
–Gabriel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

You’re welcome! :)On Mon, Sep 28, 2009 at 12:37 PM, Gabriel Gambetta wrote:

That did it. Thanks a lot!

–Gabriel

On Sat, Sep 26, 2009 at 4:59 AM, Sam Lantinga <@slouken> wrote:

This is fixed for the next SDL_ttf release, thanks!

On Fri, Sep 25, 2009 at 7:51 AM, Gabriel Gambetta wrote:

I’m having problems with SDL_TTF and certain fonts - namely, that the
bottom
part of some glyphs is cut. See font.jpg. This is a test app, but
showfont
included in SDL_TTF does the same.

I opened the font with two different editors, FontForge and FontCreator.
FontForge shows a descent line that matches the place where the rendered
fonts are cut, while FontCreator shows a different one that says
WinDescent.
See the other two screenshots.

This font shows correctly in every other app that uses it, so my guess
is
that it’s a problem with SDL_TTF or FreeType. We can reproduce this in
Linux, Windows and Mac.

Does anyone know what’s going on, or more importantly, how can it be
fixed?

Thanks,
–Gabriel


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


? ? ? ?-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

it seems the issue is not fixed on some font such as digital_7.ttf

Can you report a bug with a link to sample font and steps in Bugzilla?
http://bugzilla.libsdl.org/

Thanks!On Tue, Feb 9, 2010 at 6:05 AM, Je wrote:

it seems the issue is not fixed on some font such as digital_7.ttf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC