- remap_pos=0;
- for(t=0;t<font->num_glyphs;t++) {
- gfxglyph_t*src = &font->glyphs[t];
- int u = font->glyphs[t].unicode;
- if(invalid_unicode(u)) {
- u = 0xe000 + remap_pos++;
+
+ if(!font->unicode2glyph) {
+ for(t=0;t<font->num_glyphs;t++) {
+ gfxglyph_t*src = &font->glyphs[t];
+ int u = font->glyphs[t].unicode;
+ if(u<=0)
+ continue;
+ if(u<32) {
+ msg("<warning> gfxfont_to_ttf: glyph %d has an invalid unicode (%d)", t, u);
+ continue;
+ } else if(ttf->unicode[u]) {
+ msg("<warning> gfxfont_to_ttf: glyph %d has a duplicate unicode (%d)", t, u);
+ continue;
+ }
+ if(u<ttf->unicode_size)
+ ttf->unicode[u] = t+offset;