From 2fdae0bb8352fa316b447b1ebb719e1132817021 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 19 Oct 2004 10:38:01 +0200 Subject: initialise cidtogid field in pdf_font --- mupdf/font.c | 2 ++ 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) -- cgit v1.2.3