On Tue, 2009-12-01 at 14:24 +0000, Andre DRASZIK wrote: > Hi, > > I have posted this before, but received no comments. > > There is an off by one bug in GetStringBreak() and as such it returns > too many characters in certain cases. > > Attached is a test case, which will need an 'arial.ttf' in the same > directory as the test app is being run from. > > For this test case, GetStringWidth() will return 731 pixels instead of > sth < 730 as one would expect. Basically because GetStringBreak() > returns one character too much (in this case) in ret_str_length, i.e. > for the test app it should be 59 instead of 60 (for the first line of > text). > > The attached patch fixes the issue.
You probably have a point here and this should be fixed. But I don't quite understand why your test code takes the hard way of calculating the number of bytes from the number of characters. You can simply subtract the pointers into the string buffer, can't you ? Sven _______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev