[SDL] SDL_ttf bug with the letter j

Kent Quirk kent_quirk at cognitoy.com
Tue Jul 30 20:20:00 PDT 2002

If you look at your image closely, you'll realize that the artifact is
the left few pixels of the j, cut off and one line higher.

Apparently, when it's at the front of the string, the x coordinate of
the pixels is going negative and wrapping to the right side one line

I have no idea WHY this is happening, as I don't use SDL_ttf. It could
be your code, it could be code in the library. Does SDL_ttf specify
the draw routines, or do you? If you do, then it could easily be your
code dealing improperly with negative coordinates.

You might look for similar behavior in uppercase V, lowercase y, and
italic fonts.


Tuesday, July 30, 2002, 12:35:26 AM, you wrote:

> Hello, I'm having a problem with the SDL_ttf library
> (2.0.5) with the letter j (lowercase). I'm getting a
> weird artifact on the texture which appears on the
> right side of the texture. The problem varies
> depending on the point size and location of the j.
> However, it usually shows up at larger point sizes and
> when j is in front of the string. And the problem is
> always reproducable once you find the settings. And I
> have verified this on two totally different computers.

> I have included two sample screenshots of the problem
> running different font types (arial and times). The
> artifact almost looks like a comma. I was running an
> unmodified version of "showfont" which is the demo
> that comes with the library. (I also get this behavior
> with glfont.) I specified 60 point for this screen
> capture and used the strings "j" and "join". 

> So far, I have only found the problem with the
> lowercase j.

> This is a particular problem for me because I have
> written an OpenGL routine ontop of SDL_ttf that loads
> each letter individually into its own texture and
> display list so I can do stuff similar to the example
> in the OpenGL Programming Guide. So I get this problem
> almost everytime I use the letter j.

> Can somebody tell me what's causing this and how I can
> fix this?

> Also, is there a way I can coerce the SDL_ttf to load
> bitmap fonts in .FON format as well as .TTF? I noticed
> that the library can actually load the .FON files, but
> quits once it realizes the fonts aren't vectors
> (scalable).

> Thanks,
> Eric

> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com

Kent Quirk, CTO, CogniToy
kent_quirk at cognitoy.com

More information about the SDL mailing list