+ line_offs = *(line_offs_it++);
+ line_chars = *(line_chars_it++);
+ }
+
+ if (i->flags & GS_SOFTHYPHEN)
+ continue;
+
+ if (!(i->flags & GS_INVERT))
+ {
+ lookup8 = lookup8_normal;
+ lookup16 = lookup16_normal;
+ lookup32 = lookup32_normal;
+ } else
+ {
+ lookup8 = lookup8_invert;
+ lookup16 = lookup16_invert;
+ lookup32 = lookup32_invert;
+ }
+
+ static FTC_SBit glyph_bitmap;
+ if (fontRenderClass::instance->getGlyphBitmap(&i->font->font, i->glyph_index, &glyph_bitmap))
+ continue;
+ int rx=i->x+glyph_bitmap->left + offset.x();
+ int ry=(doTopBottomReordering ? line_offs : i->y) - glyph_bitmap->top + offset.y();
+
+ __u8 *d=(__u8*)(surface->data)+buffer_stride*ry+rx*surface->bypp;
+ __u8 *s=glyph_bitmap->buffer;
+ register int sx=glyph_bitmap->width;
+ int sy=glyph_bitmap->height;
+ if ((sy+ry) >= clip.rects[c].bottom())
+ sy=clip.rects[c].bottom()-ry;
+ if ((sx+rx) >= clip.rects[c].right())
+ sx=clip.rects[c].right()-rx;
+ if (rx < clip.rects[c].left())
+ {
+ int diff=clip.rects[c].left()-rx;
+ s+=diff;
+ sx-=diff;
+ rx+=diff;
+ d+=diff*surface->bypp;
+ }
+ if (ry < clip.rects[c].top())
+ {
+ int diff=clip.rects[c].top()-ry;
+ s+=diff*glyph_bitmap->pitch;
+ sy-=diff;
+ ry+=diff;
+ d+=diff*buffer_stride;
+ }
+ if (sx>0)
+ {
+ switch(opcode) {
+ case 0: // 4bit lookup to 8bit
+ for (int ay=0; ay<sy; ay++)
+ {
+ register __u8 *td=d;
+ register int ax;
+ for (ax=0; ax<sx; ax++)
+ {
+ register int b=(*s++)>>4;
+ if(b)
+ *td++=lookup8[b];
+ else
+ td++;
+ }
+ s+=glyph_bitmap->pitch-sx;
+ d+=buffer_stride;