From 405f7bcba3314e746fd3893565bd77d775f6547a Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 24 Feb 2010 17:59:21 -0800 Subject: [PATCH] even more ttf bugfixes --- lib/devices/pdf.c | 11 +++++++++++ lib/ttf.c | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/devices/pdf.c b/lib/devices/pdf.c index 8ecfa87..3183ce8 100644 --- a/lib/devices/pdf.c +++ b/lib/devices/pdf.c @@ -392,6 +392,17 @@ void pdf_addfont(gfxdevice_t*dev, gfxfont_t*font) font->unicode2glyph = 0; gfxfont_save(font, filename); font->id=old_id; + +#ifdef RUN_TTX + /* for testing the generated fonts: run everything through ttx (fonttools) */ + char cmd[256]; + sprintf(cmd, "mv %s.ttf test.ttf", fontname);system(cmd); + system("rm -f test.ttx"); + if(system("ttx test.ttf")&0xff00) exit(1); + sprintf(cmd, "mv test.ttf %s.old.ttf", fontname, fontname);system(cmd); + sprintf(cmd, "ttx test.ttx;mv test.ttf %s.ttf", fontname);system(cmd); + sprintf(cmd, "rm -f test.ttx");system(cmd); +#endif int l = strlen(font->id); for(t=0;tmaxContours=1; if(ttf->num_glyphs) { - int max = 0; + int max = 1; for(t=0;tnum_glyphs;t++) { if(ttf->glyphs[t].num_points>max) max = ttf->glyphs[t].num_points; -- 1.7.10.4