diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-10-19 10:38:01 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-10-19 10:38:01 +0200 |
commit | 2fdae0bb8352fa316b447b1ebb719e1132817021 (patch) | |
tree | 48d2e67451a1a5d79ee5a671e8238234a6a868c8 | |
parent | 06182a15315b390597db5c2bc32f6a3e30a4faaf (diff) | |
download | mupdf-2fdae0bb8352fa316b447b1ebb719e1132817021.tar.xz |
initialise cidtogid field in pdf_font
-rw-r--r-- | mupdf/font.c | 2 | ||||
-rw-r--r-- | tree/font.c | 21 |
2 files changed, 2 insertions, 21 deletions
diff --git a/mupdf/font.c b/mupdf/font.c index 3835a3b8..c7ff3eb9 100644 --- a/mupdf/font.c +++ b/mupdf/font.c @@ -204,6 +204,8 @@ newfont(char *name) font->missingwidth = 0; font->encoding = nil; + font->ncidtogid = 0; + font->cidtogid = nil; font->filename = nil; font->fontdata = nil; diff --git a/tree/font.c b/tree/font.c index a8ac016c..5dfaec2e 100644 --- a/tree/font.c +++ b/tree/font.c @@ -122,25 +122,6 @@ static int cmpv(const void *a0, const void *b0) return a->lo - b->lo; } -static int uniq(void *ptr, int count, int size) -{ - char *a = ptr; - char *b = ((char*)ptr) + size; - - while (count--) - { - if (memcmp(a, b, sizeof(short)) != 0) - { - a += size; - if (a != b) - memcpy(a, b, size); - } - b += size; - } - - return (a - ((char*)ptr)) / size; -} - fz_error * fz_endhmtx(fz_font *font) { @@ -150,7 +131,6 @@ fz_endhmtx(fz_font *font) return nil; qsort(font->hmtx, font->nhmtx, sizeof(fz_hmtx), cmph); - font->nhmtx = uniq(font->hmtx, font->nhmtx, sizeof(fz_hmtx)); newmtx = fz_realloc(font->hmtx, sizeof(fz_hmtx) * font->nhmtx); if (!newmtx) @@ -170,7 +150,6 @@ fz_endvmtx(fz_font *font) return nil; qsort(font->vmtx, font->nvmtx, sizeof(fz_vmtx), cmpv); - font->nvmtx = uniq(font->vmtx, font->nvmtx, sizeof(fz_vmtx)); newmtx = fz_realloc(font->vmtx, sizeof(fz_vmtx) * font->nvmtx); if (!newmtx) |