Hello. After 5 months of inactivity, I have started working on this new widget again.
Basically, I rewrote what I had done in january to remove the dependency of Expat (it now requires the mxml library that is somehow more powerfull).
Here is the result :
http://www.lakedaemon.org/XmlBox.zipI coded this the last five days and it's basically a multilinebox on steroids that allows the use of many fonts, many fonts type (freetype, packefont, monofont, glyphfont), many widths/sizes (require freetype for this), many colors, in the same window.
And it's just the start, I have grand plans for the new widget.
It requires only little changes in the woopsi library to work :
Some drawbaselinetext() methods in graphics/graphicports/basefont/packedfont files.
It is essentially the same as the drawtext methods, except that it draws the font on a BASELINE (it is necessary if you want many fonts to play well together) instead of having the bottom of the fonts on a line.
you must have a getCharTop(codepoint) {return top;} method in each font too (but the "top" number is a constant for the font..7 for arial9 for example).
I have some strange bug remaining. Could you try draging the bottom screen in the following build and tell me where it could come from :
http://www.lakedaemon.org/XmlTextBoxbug.ndsI'll post what I did in a few days one I have cleaned things up a bit.
I think that I may have found some bug in packedfont16.cpp too. See this :
void PackedFont16::renderChar(
const u16* pixelData, u16 pixelsPerRow,
MutableBitmapBase* bitmap,
s16 x, s16 y,
u16 clipX1, u16 clipY1, u16 clipX2, u16 clipY2)
{
u16 colour = getColour();
//
//
// Test if there is rendering to be done
//
//
if ((clipY2< y) || (clipY1> y +getHeight()-1) || (x>clipX2) || (x+pixelsPerRow< clipX1)) return;
// There is a bug there if you don't do these tests : if y is much smaller than y, you'll be copying lots of pixels in the following while loop
//
// BUG THERE
//
//
// adjust clipY2 to be the last row+1 in the glyph
// so we only write while (y<=clipY2)
if (clipY2 > y + getHeight() - 1) {
clipY2 = y + getHeight() - 1;
}
...some code...
while (y <= clipY2) {
pixels get copied
};
Best regards,
Lakedaemon