X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxfont.c;h=8650880cae8be8fac9fcb801b6be03fc2de2c508;hb=b7121844bf21b1c022aaeb26cd4c98148ab1ed29;hp=c1b82eb17454122ba2272afd93eb3a3fb1816d0a;hpb=0d97c44e7f70eef1b199373ef7b586749eb409c8;p=swftools.git diff --git a/lib/gfxfont.c b/lib/gfxfont.c index c1b82eb..8650880 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -570,6 +570,7 @@ void gfxfont_fix_unicode(gfxfont_t*font) int u = font->glyphs[t].unicode; if(u>=0) { assert(font->unicode2glyph[u]<0); // we took care of duplicates, right? + assert(umax_unicode); font->unicode2glyph[u] = t; } } @@ -664,6 +665,20 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font) } } + dest->bearing = dest->xmin; + /* make sure coordinates are always to the right of the origin */ + int xshift=0; + if(dest->xmin < 0) { + xshift = -dest->xmin; + for(s=0;spoints[s].x += xshift; + } + dest->xmin += xshift; + dest->xmax += xshift; + } + + //dest->xmin=0; //TODO: might be necessary for some font engines? + dest->advance = src->advance*scale; int u = font->glyphs[t].unicode; @@ -691,7 +706,7 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font) } } else { int u; - for(u=1;uunicode_size;u++) { + for(u=1;umax_unicode;u++) { int g = font->unicode2glyph[u]; if(g>=0 && u<32) { msg(" gfxfont_to_ttf: Font contains an invalid unicode (%d)", u);