void WriteText(Display display, Surface surface, int x, int y, const char * text, int len, int prevGlyph, int * rPrevGlyph)
{
- if(len && text[0])
+ if(len && text[0] && surface.font)
{
OGLSurface oglSurface = surface.driverData;
OGLSystem oglSystem = display.displaySystem.driverData;
FT_Set_Transform(fontEntry.face, &matrix, &pen );
FaceSetCharSize(fontEntry.face, size);
height = (int)((fontEntry.face->size->metrics.height) >> 6); //* y_scale;
+ if(!height)
+ height = size * 96 / 72 + 4;
// printf("Font height is %d\n", height);
this.fakeItalic = info.fakeItalic;
}
int h = (int)face->size->metrics.height;
int desc = (int)face->size->metrics.descender;
int oy = (numGlyphs ? shaper_item.offsets[index].y : 0);
+ if(!h)
+ h = height * 64;
oy += h + desc - glyph->by;
oy >>= 6;