Simple helpful SDL_ttf extension

Hi,

Some simple code would make the SDL_ttf library much more usable for my
purposes. I was searching for a function, that tells me which character
is in the font face and will not be displayed as an ugly frame. Also
this function could be used to filter unprintable control keys.
If the Freetype2 function FT_Get_Char_Index() returns 0 for some
character, the font face will display this character as a frame.

For example:
int TTF_GlyphProvided(TTF_Font *font, Uint16 ch)
{
return FT_Get_Char_Index(font->face, ch);
}

This would help a lot.
What do you think about that?

If there’s already a function able to do that, please tell me and ignore
this message.

TIA,
Matthias

2006/10/7, Matthias Weigand :

Some simple code would make the SDL_ttf library much more usable for my
purposes. I was searching for a function, that tells me which character
is in the font face and will not be displayed as an ugly frame. Also
this function could be used to filter unprintable control keys.
If the Freetype2 function FT_Get_Char_Index() returns 0 for some
character, the font face will display this character as a frame.

For example:
int TTF_GlyphProvided(TTF_Font *font, Uint16 ch)
{
return FT_Get_Char_Index(font->face, ch);
}

This would help a lot.
What do you think about that?

If there’s already a function able to do that, please tell me and ignore
this message.

Thanks, it’s very simple but useful function for me.–
Roman Kyrylych (??? ???)