From fc32a20845d30c6734767f08d35749d5cf34fa97 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 8 Dec 2009 00:13:49 +0100 Subject: Use correct default value for DW entry in CID fonts. --- mupdf/pdf_font.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mupdf/pdf_font.c b/mupdf/pdf_font.c index ffc28c27..408d770d 100644 --- a/mupdf/pdf_font.c +++ b/mupdf/pdf_font.c @@ -216,7 +216,7 @@ pdf_newfontdesc(void) fontdesc->dhmtx.lo = 0x0000; fontdesc->dhmtx.hi = 0xFFFF; - fontdesc->dhmtx.w = 0; + fontdesc->dhmtx.w = 1000; fontdesc->dvmtx.lo = 0x0000; fontdesc->dvmtx.hi = 0xFFFF; @@ -543,6 +543,8 @@ loadcidfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *enco char collection[256]; char *basefont; int i, k, fterr; + fz_obj *obj; + int dw; /* * Get font name and CID collection @@ -552,7 +554,6 @@ loadcidfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *enco { fz_obj *cidinfo; - fz_obj *obj; char tmpstr[64]; int tmplen; @@ -703,8 +704,11 @@ loadcidfont(pdf_fontdesc **fontdescp, pdf_xref *xref, fz_obj *dict, fz_obj *enco /* * Horizontal */ - - pdf_setdefaulthmtx(fontdesc, fz_toint(fz_dictgets(dict, "DW"))); + dw = 1000; + obj = fz_dictgets(dict, "DW"); + if (obj) + dw = fz_toint(obj); + pdf_setdefaulthmtx(fontdesc, dw); widths = fz_dictgets(dict, "W"); if (widths) -- cgit v1.2.3