[SDL] [SDL_ttf] disable kerning or provide a function

William Konopka pstrychuj at gmail.com
Sat Sep 22 02:54:51 PDT 2007


Hi, 

I've been trying to use SDL_ttf for my project. I'm designing a lightweight
widget tool set for SDL. I've run into a problem during implementation of a text
editing widget. The thing is that I'm trying to calculate the position (in the
string) of a character under a mouse pointer (to allow text selection)

Unfortunately, there is no documented functionality to perform this. I could be
rendering all the glyphs solely and put them together in the end (but
"officially" I don't know how to merge a few surfaces into one - such functions
as SDL_AllocSurface are undocumented, and rendering many surfaces instead of one
would, as I suppose, slow the application down, not to mention the redundancy in
data structures)

I see two solutions to the problem. Either you provide an option to disable
kerning for a font (the quick and dirty solution), or a function that takes the
relative coordinates of mouse pointer and returns the string position of an
element pointed by the pointer. Whadda ya say?






More information about the SDL mailing list