X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxfont.c;h=5004e18359b02a90f3201107b885a0586fe9ab8e;hp=8e392728b3fb343ea7fc656cb85c7e65d2adef18;hb=b27d77f8a6343e60e2d3ae2c22a8096a6357a927;hpb=77329c490e5346658e4878f065022abb64df5324 diff --git a/lib/gfxfont.c b/lib/gfxfont.c index 8e39272..5004e18 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -597,16 +597,22 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font) } ttf->unicode_size = max_unicode+1; ttf->unicode = rfx_calloc(sizeof(unicode_t)*ttf->unicode_size); + int remap_pos=0; for(t=0;tnum_glyphs;t++) { gfxglyph_t*src = &font->glyphs[t]; int u = font->glyphs[t].unicode; + if(u<32 || (u>=0xe000 && u<0xf900)) { + u = 0xe000 + remap_pos++; + } if(u>=0) ttf->unicode[u] = t+offset; } int u; for(u=0;umax_unicode;u++) { int g = font->unicode2glyph[u]; - if(g>=0) { + if(u<32 || (u>=0xe000 && u<0xf900)) + continue; + if(g>=0 && !ttf->unicode[u]) { ttf->unicode[u] = g+offset; } } @@ -614,6 +620,8 @@ ttf_t* gfxfont_to_ttf(gfxfont_t*font) ttf->descent = font->descent; ttf->lineGap = font->ascent + font->descent; + ttf->name = strdup(font->id); + ttf_create_truetype_tables(ttf); return ttf; }