PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Bug with SimpleFonts

There seems to be a minor bug with Simple Fonts and the surface height. It's off by 1 if you try to draw the Simple Font onto another surface that's the size of the height.

IE
SimpleFont Surface ---> GapiSurface of size (SimpleFont Width, SimpleFont Height) = invalid rect when calling DrawText because height needs to be + 1 on GapiSurface being drawn on.
Strange.. I just browsed the source and it looks ok.. I guess it´s stupid of me to ask if you are using 1.04, right? There were some minor bug fixes included in the 1.03 release...

If you are using 1.04, let me just guess: If you specify GapiDraw to draw on {0, 0} it does draw on Y=0, but you have to have a surface that is 1 pixel taller than the font image. Leif Kornstedt reported a similar issue with Blt in PocketKobo, but I thought I had fixed it...

/Johan
that would be correct and yup, it's with 1.04
I found the problem. Regular Bitmap fonts in a previous version of GapiDraw reported the size with the additional pixel for the line so I was subtracting 1 from my surface earlier in the program.
Ok, cool. It's always nice to keep the bug count at zero in a release... If you use myadvancedkernedfontsurface.GetHeight() I guess you still would have to use -1 though...

For the rest of you reading this topic: This is not a bug. :)

/Johan
It was hidden among 1000 lines of object source for my various GUI controls so I kinda missed it. Gotta love how inheritance can obfusticate your code just as easily as make it clearer.