On Mon, Jan 28, 2008 at 02:27:40PM +0000, Andre DRASZIK wrote: > Hi, > > it's not hard to implement everything you want using > IDirectFBFont::GetStringWidth() and then draw one line at a time. > Justification can be done using DSTF_TOPLEFT et al. > Why do you think you can't implement this on top of DirectFB?
It would seem to me that it is suboptimal to implement it on top, because you don't know in advance the size of the text. So, basically, you would make a guess, see if getstringwidth is bigger or smaller than the desired width, and then use dichotomy to reach that size. While doing it internally, you could add the chars one by one, until the size is reached, and even have code for adding justification and stuff like that. You could also have another mode to crop the text after a certain width, altough it is probably possible to do that by cropping surfaces while blitting. > For more advanced text rendering you should consider using pango. How big a dependency set does pango pull in ? Is this an option for small-storage applications ? > You should also remember that the length in bytes may legally be != > length in characters, since this is UTF-8 encoded text. Exact, so one more reason to do it internally, since directfb getstringwidth knows about the size of the text as it will be ? Friendly, Sven Luther _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev