diff --git a/src/sys/graphics/objfont.cpp b/src/sys/graphics/objfont.cpp index d2febfc..148b717 100755 --- a/src/sys/graphics/objfont.cpp +++ b/src/sys/graphics/objfont.cpp @@ -98,17 +98,17 @@ void TBMFont::PutText(UInt32 x, UInt32 y, const char * TextString) { UInt32 xx, yy; - char * offset; + UInt8 * offset; UInt8 pix; char ch; if (!FontData) return; while (*TextString) { ch = *TextString; if ((CharWidthTable[ch]) && (ch!=' ')) { - offset=(FontData+((char)FontDataIdx[ch])); - for (yy=0; yy<=CharHeightTable[ch]-1; yy++) - for (xx=0; xx<=CharWidthTable[ch]-1; xx++) { - pix = (UInt8)*offset; + offset=(UInt8 *)((UInt32)FontData+(UInt32)FontDataIdx[ch]); + for (yy=0; yy<=(UInt32)(CharHeightTable[ch]-1); yy++) + for (xx=0; xx<=(UInt32)(CharWidthTable[ch]-1); xx++) { + pix = *offset; if (pix) Buf->putpixel(x+xx,y+yy,ColourTable[pix]); } // for xx x+=CharWidthTable[ch]; diff --git a/src/sys/graphics/objfont.h b/src/sys/graphics/objfont.h index f3a65bd..fb24637 100755 --- a/src/sys/graphics/objfont.h +++ b/src/sys/graphics/objfont.h @@ -29,12 +29,12 @@ class TFont { protected: - char * FontDataIdx[256]; + void * FontDataIdx[256]; UInt16 CharWidthTable[256]; UInt16 CharHeightTable[256]; TGfx0* Buf; UInt32 FontDataSize; - char * FontData; + void * FontData; public: TFont(TGfx0 *); virtual void PutText(Int32, Int32,const char *)=0;