63 static char default_font_palette[] = {
64 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
70 if (Is_Texture_Valid(font, str, fore, back, conv)) {
73 if (TextureString)
delete[] TextureString;
77 BackgroundColor = back;
78 ForegroundColor = fore;
82 default_font_palette[0] = back;
83 default_font_palette[1] = fore;
98 font.
Print(str, bsurf, rect,
TPoint2D<int>(0,0), conv, (
unsigned char *)default_font_palette);
105 float fsize = sqrt(fw * fh);
106 TextureSize =
Find_POT(ceil(fsize));
108 if ((TextureSize / fh) * TextureSize < fw) {
115 BSurface bsurf2(TextureSize, TextureSize, 1);
120 int mw = (fw & (TextureSize - 1)) ? (fw / TextureSize)+1 : (fw /TextureSize);
124 for (
int lp = 0; lp < mw; lp ++) {
125 int blitw =
MIN(fw - (TextureSize *lp), TextureSize);
126 int lp_tsize = lp * TextureSize;
127 Rect destrect(0,fh*lp,blitw,fh*lp+fh);
128 Rect srcrect(lp_tsize, 0, lp_tsize + blitw, fh);
132 bsurf2.
Blit_From(destrect,bsurf,srcrect);
virtual Point2D Print(char const *string, Surface &surface, Rect const &cliprect, Point2D const &point, ConvertClass const &converter, unsigned char const *remap=NULL) const =0
bool Build_Texture(FontClass &font, const char *str, int fore, int back, ConvertClass &conv)
virtual bool Blit_From(Rect const &dcliprect, Rect const &destrect, Surface const &source, Rect const &scliprect, Rect const &sourcerect, bool trans=false)