- gfxdrawer_target_gfxline(&draw);
- info.draw = &draw;
- info.quality = quality;
-
- //error = FT_Outline_Decompose(&face->glyph->outline, &outline_functions, &info);
- error = FT_Outline_Decompose(&face->glyph->outline, &outline_functions, &info);
-
- if(error) {
- fprintf(stderr, "Couldn't decompose glyph %d\n", t);
- gfxline_free((gfxline_t*)draw.result(&draw));
- continue;
+ if(!omit) {
+ gfxline_t*l;
+ int ok=0;
+ gfxdrawer_target_gfxline(&draw);
+ info.draw = &draw;
+ info.quality = quality;
+
+ //error = FT_Outline_Decompose(&face->glyph->outline, &outline_functions, &info);
+ error = FT_Outline_Decompose(&face->glyph->outline, &outline_functions, &info);
+
+ if(error) {
+ fprintf(stderr, "Couldn't decompose glyph %d\n", t);
+ gfxline_free((gfxline_t*)draw.result(&draw));
+ FT_Done_Glyph(glyph);
+ omit = 4;
+ } else {
+ font->glyphs[font->num_glyphs].advance = (glyph->advance.x*20)/65536;
+ font->glyphs[font->num_glyphs].line = (gfxline_t*)draw.result(&draw);
+ }
+ l = font->glyphs[font->num_glyphs].line;
+ while(l) {
+ if(l->type != gfx_moveTo) {
+ ok = 1;
+ }
+ l = l->next;
+ }
+ if(!ok && !name) {
+ gfxline_free(font->glyphs[font->num_glyphs].line);
+ font->glyphs[font->num_glyphs].line = 0;
+ font->glyphs[font->num_glyphs].advance = 0;
+
+ /* Some PDFs created e.g. by InDesign tend to create
+ fonts with reduced (empty) characters, which still
+ have unicode indices attached to them.
+ Remove that information, in order to not confuse
+ any converter applications.
+ */
+ font->glyphs[font->num_glyphs].unicode = 0;
+ if(font->glyphs[font->num_glyphs].name) {
+ free(font->glyphs[font->num_glyphs].name);
+ font->glyphs[font->num_glyphs].name = 0;
+ }
+ FT_Done_Glyph(glyph);
+ omit = 5;
+ }