373 if (
string ==
NULL)
return(drawpoint);
379 int xpos = point.
Bias_To(cliprect).
X;
381 int ypos = point.
Bias_To(cliprect).
Y;
384 int xspacing = FontXSpacing + Raw_Width()/
FUDGEDIV;
385 int yspacing = FontYSpacing + Raw_Width()/
FUDGEDIV;
388 static unsigned char const fontpalette[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
390 remap = RemapPalette;
392 remap = &fontpalette[0];
398 converter = &convertref;
412 if (xpos >= cliprect.
X+cliprect.
Width || ypos >= cliprect.
Y+cliprect.
Height) {
419 void * buffer = surface.
Lock();
420 if (buffer !=
NULL) {
422 unsigned char * fontwidth = ((
unsigned char*)FontData) + FontData->WidthBlockOffset;
423 unsigned short * fontheight = (
unsigned short*)(((
unsigned char*)FontData) + FontData->HeightOffset);
424 unsigned short * fontoffset = (
unsigned short*)(((
unsigned char*)FontData) + FontData->OffsetBlockOffset);
430 while (*
string !=
'\0') {
431 unsigned char c = *
string++;
439 ypos += Raw_Height() + ((yspacing > 0) ? yspacing : 0);
444 ypos += Raw_Height() + ((yspacing > 0) ? yspacing : 0);
452 int width = fontwidth[c];
453 int dheight = fontheight[c] >> 8;
454 int firstrow = fontheight[c] & 0xFF;
460 Rect crect(xpos, ypos, width+((xspacing > 0) ? xspacing : 0), *(((
unsigned char *)FontData) + FontData->InfoBlockOffset +
FONTINFOMAXHEIGHT) + ((yspacing > 0) ? yspacing : 0));
481 if (FontData->FontCompress != (
char) 2) {
482 unsigned char * dataptr = ((
unsigned char *)FontData) + fontoffset[c];
483 void * drawbuff = (
void*)(((
char*)buffer) + ((ypos + firstrow) * surface.
Stride()) + xpos * bbp);
485 for (
int h = 0; h < dheight; h++) {
491 if (ypos + firstrow + h >= crect.
Y + crect.
Height)
break;
497 if (ypos + firstrow + h < crect.
Y) {
498 drawbuff = (
void*)(((
char*)drawbuff) + surface.
Stride());
499 dataptr = dataptr + ((width+1)/2);
508 int workwidth = width;
509 while (workwidth > 0) {
515 int c1 = remap[*dataptr & 0x0F];
516 int c2 = remap[(*dataptr++ & 0xF0) >> 4];
522 if (dx >= cliprect.
X && dx < cliprect.
X+cliprect.
Width) {
532 drawbuff = ((
char*)drawbuff) + bbp;
534 if (workwidth == 0)
break;
540 if (dx >= cliprect.
X && dx < cliprect.
X+cliprect.
Width) {
550 drawbuff = ((
char*)drawbuff) + bbp;
558 drawbuff = (
void*)((((
char*)drawbuff) - (width*bbp)) + surface.
Stride());
563 unsigned char * dataptr = ((
unsigned char *)FontData) + fontoffset[c] + FontData->DataBlockOffset;
564 void * drawbuff = (
void*)(((
char*)buffer) + ((ypos + firstrow) * surface.
Stride()) + xpos * bbp);
566 for (
int h = 0; h < dheight; h++) {
572 if (ypos + firstrow + h >= crect.
Y + crect.
Height)
break;
578 if (ypos + firstrow + h < crect.
Y) {
579 drawbuff = (
void*)(((
char*)drawbuff) + surface.
Stride());
580 dataptr = dataptr + width;
589 int workwidth = width;
590 while (workwidth > 0) {
595 int c1 = remap[*dataptr++];
601 if (dx >= cliprect.
X && dx < cliprect.
X+cliprect.
Width) {
611 drawbuff = ((
char*)drawbuff) + bbp;
619 drawbuff = (
void*)((((
char*)drawbuff) - (width*bbp)) + surface.
Stride());
628 point =
Point2D(xpos - cliprect.
X, ypos - cliprect.
Y);
virtual Point2D Print(char const *string, Surface &surface, Rect const &cliprect, Point2D const &point, ConvertClass const &converter, unsigned char const *remap=NULL) const