diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2005-10-14 23:10:35 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2005-10-14 23:10:35 +0000 |
commit | 1342da44bfdfc62e72509cd7c218e58c37b3895f (patch) | |
tree | b5de87dd2b542745fd43e87d39f8a47996643c3d /graphics/xpdf | |
parent | * Allow for compilation to optionally use the MIT Kerberos 5 port like (diff) |
- Update to 3.01.
- Fix size_t bug and default X11 font.
OK'd by: nork (maintainer)
Notes
Notes:
svn path=/head/; revision=145424
Diffstat (limited to 'graphics/xpdf')
-rw-r--r-- | graphics/xpdf/Makefile | 3 | ||||
-rw-r--r-- | graphics/xpdf/distinfo | 4 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-configure.in | 18 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-gmem | 79 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-security | 342 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-security2 | 58 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-truetype.patch | 384 | ||||
-rw-r--r-- | graphics/xpdf/files/patch-xfont | 11 |
8 files changed, 93 insertions, 806 deletions
diff --git a/graphics/xpdf/Makefile b/graphics/xpdf/Makefile index 71a67628d2d3..f3fc12c4b8e9 100644 --- a/graphics/xpdf/Makefile +++ b/graphics/xpdf/Makefile @@ -6,8 +6,7 @@ # PORTNAME= xpdf -PORTVERSION= 3.00 -PORTREVISION= 7 +PORTVERSION= 3.01 CATEGORIES= graphics print MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \ ${MASTER_SITE_TEX_CTAN} diff --git a/graphics/xpdf/distinfo b/graphics/xpdf/distinfo index b14dc7cf47be..f02c2231b371 100644 --- a/graphics/xpdf/distinfo +++ b/graphics/xpdf/distinfo @@ -1,2 +1,2 @@ -MD5 (xpdf-3.00.tar.gz) = 95294cef3031dd68e65f331e8750b2c2 -SIZE (xpdf-3.00.tar.gz) = 534697 +MD5 (xpdf-3.01.tar.gz) = e004c69c7dddef165d768b1362b44268 +SIZE (xpdf-3.01.tar.gz) = 599778 diff --git a/graphics/xpdf/files/patch-configure.in b/graphics/xpdf/files/patch-configure.in deleted file mode 100644 index 5eeba456e3f0..000000000000 --- a/graphics/xpdf/files/patch-configure.in +++ /dev/null @@ -1,18 +0,0 @@ ---- configure.in.orig Fri May 7 22:54:35 2004 -+++ configure.in Fri May 7 22:33:28 2004 -@@ -306,10 +306,13 @@ - dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is - dnl ##### the reason that Xpdf requires 2.0.5+.) - smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+], -- FT_Get_Name_Index, freetype/freetype.h, -lm) -+ FT_Get_Name_Index, freetype/ft2build.h, -lm) - if test x"$freetype2_LIBS" = x; then - smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+], -- FT_Get_Name_Index, freetype.h, -lm) -+ FT_Get_Name_Index, ft2build.h, -lm) -+ if test "x$smr_have_freetype2_library" = xyes; then -+ AC_DEFINE(HAVE_FREETYPE_H) -+ fi - fi - AC_SUBST(freetype2_LIBS) - AC_SUBST(freetype2_CFLAGS) diff --git a/graphics/xpdf/files/patch-gmem b/graphics/xpdf/files/patch-gmem new file mode 100644 index 000000000000..6f8aba2857e0 --- /dev/null +++ b/graphics/xpdf/files/patch-gmem @@ -0,0 +1,79 @@ +--- goo/gmem.c.orig Fri Sep 30 20:26:50 2005 ++++ goo/gmem.c Fri Sep 30 20:28:56 2005 +@@ -54,9 +54,9 @@ + + #endif /* DEBUG_MEM */ + +-void *gmalloc(int size) { ++void *gmalloc(size_t size) { + #ifdef DEBUG_MEM +- int size1; ++ size_t size1; + char *mem; + GMemHdr *hdr; + void *data; +@@ -96,11 +96,11 @@ + #endif + } + +-void *grealloc(void *p, int size) { ++void *grealloc(void *p, size_t size) { + #ifdef DEBUG_MEM + GMemHdr *hdr; + void *q; +- int oldSize; ++ size_t oldSize; + + if (size == 0) { + if (p) +@@ -137,8 +137,8 @@ + #endif + } + +-void *gmallocn(int nObjs, int objSize) { +- int n; ++void *gmallocn(int nObjs, size_t objSize) { ++ size_t n; + + n = nObjs * objSize; + if (objSize == 0 || n / objSize != nObjs) { +@@ -148,8 +148,8 @@ + return gmalloc(n); + } + +-void *greallocn(void *p, int nObjs, int objSize) { +- int n; ++void *greallocn(void *p, int nObjs, size_t objSize) { ++ size_t n; + + n = nObjs * objSize; + if (objSize == 0 || n / objSize != nObjs) { +--- goo/gmem.h.orig Wed Aug 17 01:34:30 2005 ++++ goo/gmem.h Fri Sep 30 20:26:38 2005 +@@ -19,13 +19,13 @@ + * Same as malloc, but prints error message and exits if malloc() + * returns NULL. + */ +-extern void *gmalloc(int size); ++extern void *gmalloc(size_t size); + + /* + * Same as realloc, but prints error message and exits if realloc() + * returns NULL. If <p> is NULL, calls malloc instead of realloc(). + */ +-extern void *grealloc(void *p, int size); ++extern void *grealloc(void *p, size_t size); + + /* + * These are similar to gmalloc and grealloc, but take an object count +@@ -33,8 +33,8 @@ + * bytes, but there is an additional error check that the total size + * doesn't overflow an int. + */ +-extern void *gmallocn(int nObjs, int objSize); +-extern void *greallocn(void *p, int nObjs, int objSize); ++extern void *gmallocn(int nObjs, size_t objSize); ++extern void *greallocn(void *p, int nObjs, size_t objSize); + + /* + * Same as free, but checks for and ignores NULL pointers. diff --git a/graphics/xpdf/files/patch-security b/graphics/xpdf/files/patch-security deleted file mode 100644 index c87c0e650ed6..000000000000 --- a/graphics/xpdf/files/patch-security +++ /dev/null @@ -1,342 +0,0 @@ ---- xpdf/Catalog.cc.orig 2004-10-18 16:51:35.824126848 +0200 -+++ xpdf/Catalog.cc 2004-10-18 16:53:06.634620045 +0200 -@@ -64,6 +64,15 @@ - } - pagesSize = numPages0 = (int)obj.getNum(); - obj.free(); -+ // The gcc doesnt optimize this away, so this check is ok, -+ // even if it looks like a pagesSize != pagesSize check -+ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize || -+ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) { -+ error(-1, "Invalid 'pagesSize'"); -+ ok = gFalse; -+ return; -+ } -+ - pages = (Page **)gmalloc(pagesSize * sizeof(Page *)); - pageRefs = (Ref *)gmalloc(pagesSize * sizeof(Ref)); - for (i = 0; i < pagesSize; ++i) { -@@ -191,6 +200,11 @@ - } - if (start >= pagesSize) { - pagesSize += 32; -+ if (pagesSize*sizeof(Page *)/sizeof(Page *) != pagesSize || -+ pagesSize*sizeof(Ref)/sizeof(Ref) != pagesSize) { -+ error(-1, "Invalid 'pagesSize' parameter."); -+ goto err3; -+ } - pages = (Page **)grealloc(pages, pagesSize * sizeof(Page *)); - pageRefs = (Ref *)grealloc(pageRefs, pagesSize * sizeof(Ref)); - for (j = pagesSize - 32; j < pagesSize; ++j) { ---- xpdf/XRef.cc.orig Thu Jan 22 10:26:45 2004 -+++ xpdf/XRef.cc Mon Jan 24 08:49:49 2005 -@@ -96,7 +96,7 @@ - } - nObjects = obj1.getInt(); - obj1.free(); -- if (nObjects == 0) { -+ if (nObjects <= 0) { - goto err1; - } - -@@ -106,7 +106,15 @@ - } - first = obj1.getInt(); - obj1.free(); -+ if (first < 0) { -+ goto err1; -+ } - -+ if (nObjects*sizeof(int)/sizeof(int) != nObjects) { -+ error(-1, "Invalid 'nObjects'"); -+ goto err1; -+ } -+ - objs = new Object[nObjects]; - objNums = (int *)gmalloc(nObjects * sizeof(int)); - offsets = (int *)gmalloc(nObjects * sizeof(int)); -@@ -130,6 +138,12 @@ - offsets[i] = obj2.getInt(); - obj1.free(); - obj2.free(); -+ if (objNums[i] < 0 || offsets[i] < 0 || -+ (i > 0 && offsets[i] < offsets[i-1])) { -+ delete parser; -+ gfree(offsets); -+ goto err1; -+ } - } - while (str->getChar() != EOF) ; - delete parser; -@@ -369,10 +383,21 @@ - } - n = obj.getInt(); - obj.free(); -+ if (first < 0 || n < 0 || first + n < 0) { -+ goto err1; -+ } - if (first + n > size) { - for (newSize = size ? 2 * size : 1024; -- first + n > newSize; -+ first + n > newSize && newSize > 0; - newSize <<= 1) ; -+ if (newSize < 0) { -+ goto err1; -+ } -+ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { -+ error(-1, "Invalid 'obj' parameters'"); -+ goto err1; -+ } -+ - entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry)); - for (i = size; i < newSize; ++i) { - entries[i].offset = 0xffffffff; -@@ -443,7 +468,7 @@ - - // check for an 'XRefStm' key - if (obj.getDict()->lookup("XRefStm", &obj2)->isInt()) { -- pos2 = obj2.getInt(); -+ pos2 = (Guint)obj2.getInt(); - readXRef(&pos2); - if (!ok) { - goto err1; -@@ -474,7 +499,14 @@ - } - newSize = obj.getInt(); - obj.free(); -+ if (newSize < 0) { -+ goto err1; -+ } - if (newSize > size) { -+ if (newSize * sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { -+ error(-1, "Invalid 'size' parameter."); -+ return gFalse; -+ } - entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry)); - for (i = size; i < newSize; ++i) { - entries[i].offset = 0xffffffff; -@@ -494,6 +526,9 @@ - } - w[i] = obj2.getInt(); - obj2.free(); -+ if (w[i] < 0 || w[i] > 4) { -+ goto err1; -+ } - } - obj.free(); - -@@ -513,13 +548,14 @@ - } - n = obj.getInt(); - obj.free(); -- if (!readXRefStreamSection(xrefStr, w, first, n)) { -+ if (first < 0 || n < 0 || -+ !readXRefStreamSection(xrefStr, w, first, n)) { - idx.free(); - goto err0; - } - } - } else { -- if (!readXRefStreamSection(xrefStr, w, 0, size)) { -+ if (!readXRefStreamSection(xrefStr, w, 0, newSize)) { - idx.free(); - goto err0; - } -@@ -551,10 +587,20 @@ - Guint offset; - int type, gen, c, newSize, i, j; - -+ if (first + n < 0) { -+ return gFalse; -+ } - if (first + n > size) { - for (newSize = size ? 2 * size : 1024; -- first + n > newSize; -+ first + n > newSize && newSize > 0; - newSize <<= 1) ; -+ if (newSize < 0) { -+ return gFalse; -+ } -+ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { -+ error(-1, "Invalid 'size' inside xref table."); -+ return gFalse; -+ } - entries = (XRefEntry *)grealloc(entries, newSize * sizeof(XRefEntry)); - for (i = size; i < newSize; ++i) { - entries[i].offset = 0xffffffff; -@@ -585,24 +631,26 @@ - } - gen = (gen << 8) + c; - } -- switch (type) { -- case 0: -- entries[i].offset = offset; -- entries[i].gen = gen; -- entries[i].type = xrefEntryFree; -- break; -- case 1: -- entries[i].offset = offset; -- entries[i].gen = gen; -- entries[i].type = xrefEntryUncompressed; -- break; -- case 2: -- entries[i].offset = offset; -- entries[i].gen = gen; -- entries[i].type = xrefEntryCompressed; -- break; -- default: -- return gFalse; -+ if (entries[i].offset == 0xffffffff) { -+ switch (type) { -+ case 0: -+ entries[i].offset = offset; -+ entries[i].gen = gen; -+ entries[i].type = xrefEntryFree; -+ break; -+ case 1: -+ entries[i].offset = offset; -+ entries[i].gen = gen; -+ entries[i].type = xrefEntryUncompressed; -+ break; -+ case 2: -+ entries[i].offset = offset; -+ entries[i].gen = gen; -+ entries[i].type = xrefEntryCompressed; -+ break; -+ default: -+ return gFalse; -+ } - } - } - -@@ -664,38 +712,48 @@ - // look for object - } else if (isdigit(*p)) { - num = atoi(p); -- do { -- ++p; -- } while (*p && isdigit(*p)); -- if (isspace(*p)) { -+ if (num > 0) { - do { - ++p; -- } while (*p && isspace(*p)); -- if (isdigit(*p)) { -- gen = atoi(p); -+ } while (*p && isdigit(*p)); -+ if (isspace(*p)) { - do { - ++p; -- } while (*p && isdigit(*p)); -- if (isspace(*p)) { -+ } while (*p && isspace(*p)); -+ if (isdigit(*p)) { -+ gen = atoi(p); - do { - ++p; -- } while (*p && isspace(*p)); -- if (!strncmp(p, "obj", 3)) { -- if (num >= size) { -- newSize = (num + 1 + 255) & ~255; -- entries = (XRefEntry *) -- grealloc(entries, newSize * sizeof(XRefEntry)); -- for (i = size; i < newSize; ++i) { -- entries[i].offset = 0xffffffff; -- entries[i].type = xrefEntryFree; -+ } while (*p && isdigit(*p)); -+ if (isspace(*p)) { -+ do { -+ ++p; -+ } while (*p && isspace(*p)); -+ if (!strncmp(p, "obj", 3)) { -+ if (num >= size) { -+ newSize = (num + 1 + 255) & ~255; -+ if (newSize < 0) { -+ error(-1, "Bad object number"); -+ return gFalse; -+ } -+ if (newSize*sizeof(XRefEntry)/sizeof(XRefEntry) != newSize) { -+ error(-1, "Invalid 'obj' parameters."); -+ return gFalse; -+ } -+ entries = (XRefEntry *) -+ grealloc(entries, newSize * sizeof(XRefEntry)); -+ for (i = size; i < newSize; ++i) { -+ entries[i].offset = 0xffffffff; -+ entries[i].type = xrefEntryFree; -+ } -+ size = newSize; -+ } -+ if (entries[num].type == xrefEntryFree || -+ gen >= entries[num].gen) { -+ entries[num].offset = pos - start; -+ entries[num].gen = gen; -+ entries[num].type = xrefEntryUncompressed; - } -- size = newSize; -- } -- if (entries[num].type == xrefEntryFree || -- gen >= entries[num].gen) { -- entries[num].offset = pos - start; -- entries[num].gen = gen; -- entries[num].type = xrefEntryUncompressed; - } - } - } -@@ -705,6 +763,10 @@ - } else if (!strncmp(p, "endstream", 9)) { - if (streamEndsLen == streamEndsSize) { - streamEndsSize += 64; -+ if (streamEndsSize*sizeof(int)/sizeof(int) != streamEndsSize) { -+ error(-1, "Invalid 'endstream' parameter."); -+ return gFalse; -+ } - streamEnds = (Guint *)grealloc(streamEnds, - streamEndsSize * sizeof(int)); - } -@@ -756,6 +818,9 @@ - keyLength = lengthObj.getInt() / 8; - } else { - keyLength = 5; -+ } -+ if (keyLength > 16) { -+ keyLength = 16; - } - permFlags = permissions.getInt(); - if (encVersion >= 1 && encVersion <= 2 && ---- xpdf/Gfx.cc.orig Thu Jan 22 10:26:45 2004 -+++ xpdf/Gfx.cc Thu Dec 23 09:48:17 2004 -@@ -2654,7 +2654,9 @@ - haveMask = gFalse; - dict->lookup("Mask", &maskObj); - if (maskObj.isArray()) { -- for (i = 0; i < maskObj.arrayGetLength(); ++i) { -+ for (i = 0; -+ i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps; -+ ++i) { - maskObj.arrayGet(i, &obj1); - maskColors[i] = obj1.getInt(); - obj1.free(); ---- xpdf/GfxState.cc.orig Thu Jan 22 10:26:45 2004 -+++ xpdf/GfxState.cc Thu Dec 23 09:48:17 2004 -@@ -708,6 +708,11 @@ - } - nCompsA = obj2.getInt(); - obj2.free(); -+ if (nCompsA > gfxColorMaxComps) { -+ error(-1, "ICCBased color space with too many (%d > %d) components", -+ nCompsA, gfxColorMaxComps); -+ nCompsA = gfxColorMaxComps; -+ } - if (dict->lookup("Alternate", &obj2)->isNull() || - !(altA = GfxColorSpace::parse(&obj2))) { - switch (nCompsA) { -@@ -1054,7 +1059,7 @@ - } - nCompsA = obj1.arrayGetLength(); - if (nCompsA > gfxColorMaxComps) { -- error(-1, "DeviceN color space with more than %d > %d components", -+ error(-1, "DeviceN color space with too many (%d > %d) components", - nCompsA, gfxColorMaxComps); - nCompsA = gfxColorMaxComps; - } diff --git a/graphics/xpdf/files/patch-security2 b/graphics/xpdf/files/patch-security2 deleted file mode 100644 index 0919d9255a75..000000000000 --- a/graphics/xpdf/files/patch-security2 +++ /dev/null @@ -1,58 +0,0 @@ ---- fofi/FoFiTrueType.cc.orig Thu Jan 22 02:26:44 2004 -+++ fofi/FoFiTrueType.cc Thu Aug 11 16:55:52 2005 -@@ -1343,6 +1343,27 @@ - return; - } - -+ // make sure the loca table is sane (correct length and entries are -+ // in bounds) -+ i = seekTable("loca"); -+ if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) { -+ parsedOk = gFalse; -+ return; -+ } -+ for (j = 0; j <= nGlyphs; ++j) { -+ if (locaFmt) { -+ pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk); -+ } else { -+ pos = getU16BE(tables[i].offset + j*2, &parsedOk); -+ } -+ if (pos < 0 || pos > len) { -+ parsedOk = gFalse; -+ } -+ } -+ if (!parsedOk) { -+ return; -+ } -+ - // read the post table - readPostTable(); - if (!parsedOk) { ---- xpdf/SplashOutputDev.cc.orig Thu Aug 11 16:51:38 2005 -+++ xpdf/SplashOutputDev.cc Thu Aug 11 16:55:52 2005 -@@ -621,16 +621,19 @@ - } - break; - case fontTrueType: -- if (!(ff = FoFiTrueType::load(fileName->getCString()))) { -- goto err2; -+ if ((ff = FoFiTrueType::load(fileName->getCString()))) { -+ codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); -+ n = 256; -+ delete ff; -+ } else { -+ codeToGID = NULL; -+ n = 0; - } -- codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff); -- delete ff; - if (!(fontFile = fontEngine->loadTrueTypeFont( - id, - fileName->getCString(), - fileName == tmpFileName, -- codeToGID, 256))) { -+ codeToGID, n))) { - error(-1, "Couldn't create a font for '%s'", - gfxFont->getName() ? gfxFont->getName()->getCString() - : "(unnamed)"); - diff --git a/graphics/xpdf/files/patch-truetype.patch b/graphics/xpdf/files/patch-truetype.patch deleted file mode 100644 index e523621f4ba9..000000000000 --- a/graphics/xpdf/files/patch-truetype.patch +++ /dev/null @@ -1,384 +0,0 @@ ---- splash/Splash.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/Splash.cc Fri May 7 20:20:08 2004 -@@ -952,7 +952,7 @@ - } - - SplashError Splash::fillChar(SplashCoord x, SplashCoord y, -- int c, SplashFont *font) { -+ int c, SplashFont *font, Unicode *u) { - SplashGlyphBitmap glyph; - int x0, y0, xFrac, yFrac; - SplashError err; -@@ -965,7 +965,7 @@ - xFrac = splashFloor((x - x0) * splashFontFraction); - y0 = splashFloor(y); - yFrac = splashFloor((y - y0) * splashFontFraction); -- if (!font->getGlyph(c, xFrac, yFrac, &glyph)) { -+ if (!font->getGlyph(c, xFrac, yFrac, &glyph, u)) { - return splashErrNoGlyph; - } - err = fillGlyph(x, y, &glyph); ---- splash/Splash.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/Splash.h Fri May 7 20:20:08 2004 -@@ -104,7 +104,7 @@ - SplashError xorFill(SplashPath *path, GBool eo); - - // Draw a character, using the current fill pattern. -- SplashError fillChar(SplashCoord x, SplashCoord y, int c, SplashFont *font); -+ SplashError fillChar(SplashCoord x, SplashCoord y, int c, SplashFont *font, Unicode *u); - - // Draw a glyph, using the current fill pattern. This function does - // not free any data, i.e., it ignores glyph->freeData. ---- splash/SplashFTFont.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFTFont.cc Fri May 7 20:20:08 2004 -@@ -125,12 +125,12 @@ - } - - GBool SplashFTFont::getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) { -- return SplashFont::getGlyph(c, xFrac, 0, bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u) { -+ return SplashFont::getGlyph(c, xFrac, 0, bitmap, u); - } - - GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) { -+ SplashGlyphBitmap *bitmap, Unicode *u) { - SplashFTFontFile *ff; - FT_Vector offset; - FT_GlyphSlot slot; -@@ -147,11 +147,21 @@ - FT_Set_Transform(ff->face, &matrix, &offset); - slot = ff->face->glyph; - -+#if 1 - if (ff->codeToGID && c < ff->codeToGIDLen) { - gid = (FT_UInt)ff->codeToGID[c]; -+ } else if (ff->modeUnicode) { -+ gid = FT_Get_Char_Index(ff->face, (FT_ULong)*u); - } else { - gid = (FT_UInt)c; - } -+#else -+ if (ff->codeToGID && c < ff->codeToGIDLen) { -+ gid = (FT_UInt)ff->codeToGID[c]; -+ } else { -+ gid = (FT_UInt)c; -+ } -+#endif - - // if we have the FT2 bytecode interpreter, autohinting won't be used - #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER -@@ -196,7 +206,7 @@ - return gTrue; - } - --SplashPath *SplashFTFont::getGlyphPath(int c) { -+SplashPath *SplashFTFont::getGlyphPath(int c, Unicode *u) { - static FT_Outline_Funcs outlineFuncs = { - &glyphPathMoveTo, - &glyphPathLineTo, -@@ -214,11 +224,21 @@ - ff->face->size = sizeObj; - FT_Set_Transform(ff->face, &matrix, NULL); - slot = ff->face->glyph; -+#if 1 -+ if (ff->codeToGID && c < ff->codeToGIDLen) { -+ gid = (FT_UInt)ff->codeToGID[c]; -+ } else if (ff->modeUnicode) { -+ gid = FT_Get_Char_Index(ff->face, (FT_ULong)*u); -+ } else { -+ gid = (FT_UInt)c; -+ } -+#else - if (ff->codeToGID && c < ff->codeToGIDLen) { - gid = ff->codeToGID[c]; - } else { - gid = (FT_UInt)c; - } -+#endif - if (FT_Load_Glyph(ff->face, gid, FT_LOAD_DEFAULT)) { - return NULL; - } ---- splash/SplashFTFont.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFTFont.h Fri May 7 22:53:52 2004 -@@ -15,7 +15,8 @@ - #pragma interface - #endif - --#include <freetype/freetype.h> -+#include <ft2build.h> -+#include FT_FREETYPE_H - #include "SplashFont.h" - - class SplashFTFontFile; -@@ -33,15 +34,15 @@ - - // Munge xFrac and yFrac before calling SplashFont::getGlyph. - virtual GBool getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u); - - // Rasterize a glyph. The <xFrac> and <yFrac> values are the same - // as described for getGlyph. - virtual GBool makeGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u); - - // Return the path for a glyph. -- virtual SplashPath *getGlyphPath(int c); -+ virtual SplashPath *getGlyphPath(int c, Unicode *u); - - private: - ---- splash/SplashFTFontEngine.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFTFontEngine.cc Fri May 7 20:20:08 2004 -@@ -107,7 +107,12 @@ - SplashFontFile *ret; - - if (!(ff = FoFiTrueType::load(fileName))) { -- return NULL; -+ ret = SplashFTFontFile::loadTrueTypeFont(this, idA, -+ fileName, gTrue, -+ codeToGID, codeToGIDLen); -+ -+ delete ff; -+ return ret; - } - tmpFileName = NULL; - if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) { ---- splash/SplashFTFontFile.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFTFontFile.cc Fri May 7 20:20:08 2004 -@@ -43,7 +43,7 @@ - } - - return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA, -- faceA, codeToGIDA, 256); -+ faceA, gFalse, codeToGIDA, 256); - } - - SplashFontFile *SplashFTFontFile::loadCIDFont(SplashFTFontEngine *engineA, -@@ -59,7 +59,7 @@ - } - - return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA, -- faceA, codeToGIDA, codeToGIDLenA); -+ faceA, gFalse, codeToGIDA, codeToGIDLenA); - } - - SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA, -@@ -69,19 +69,39 @@ - Gushort *codeToGIDA, - int codeToGIDLenA) { - FT_Face faceA; -+ GBool modeUnicodeA = gFalse; - - if (FT_New_Face(engineA->lib, fileNameA, 0, &faceA)) { - return NULL; - } - -+#if 1 -+ if (!codeToGIDLenA) { -+ int i; -+ modeUnicodeA = gTrue; -+ -+ for (i = 0; i < faceA->num_charmaps; ++i) { -+ if ((faceA->charmaps[i]->platform_id == 3 && -+ faceA->charmaps[i]->encoding_id == 1) || -+ faceA->charmaps[i]->platform_id == 0) { -+ break; -+ } -+ } -+ if (i == faceA->num_charmaps) { -+ i = 0; -+ } -+ if (i) FT_Set_Charmap(faceA, faceA->charmaps[i]); -+ } -+#endif -+ - return new SplashFTFontFile(engineA, idA, fileNameA, deleteFileA, -- faceA, codeToGIDA, codeToGIDLenA); -+ faceA, modeUnicodeA, codeToGIDA, codeToGIDLenA); - } - - SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA, - SplashFontFileID *idA, - char *fileNameA, GBool deleteFileA, -- FT_Face faceA, -+ FT_Face faceA, GBool modeUnicodeA, - Gushort *codeToGIDA, int codeToGIDLenA): - SplashFontFile(idA, fileNameA, deleteFileA) - { -@@ -89,6 +109,7 @@ - face = faceA; - codeToGID = codeToGIDA; - codeToGIDLen = codeToGIDLenA; -+ modeUnicode = modeUnicodeA; - } - - SplashFTFontFile::~SplashFTFontFile() { ---- splash/SplashFTFontFile.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFTFontFile.h Fri May 7 22:51:30 2004 -@@ -15,7 +15,8 @@ - #pragma interface - #endif - --#include <freetype/freetype.h> -+#include <ft2build.h> -+#include FT_FREETYPE_H - #include "SplashFontFile.h" - - class SplashFontFileID; -@@ -53,13 +54,14 @@ - SplashFTFontFile(SplashFTFontEngine *engineA, - SplashFontFileID *idA, - char *fileNameA, GBool deleteFileA, -- FT_Face faceA, -+ FT_Face faceA, GBool modeUnicodeA, - Gushort *codeToGIDA, int codeToGIDLenA); - - SplashFTFontEngine *engine; - FT_Face face; - Gushort *codeToGID; - int codeToGIDLen; -+ GBool modeUnicode; - - friend class SplashFTFont; - }; ---- splash/SplashFont.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFont.cc Fri May 7 20:20:08 2004 -@@ -89,7 +89,7 @@ - } - - GBool SplashFont::getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) { -+ SplashGlyphBitmap *bitmap, Unicode *u) { - SplashGlyphBitmap bitmap2; - int size; - Guchar *p; -@@ -122,7 +122,7 @@ - } - - // generate the glyph bitmap -- if (!makeGlyph(c, xFrac, yFrac, &bitmap2)) { -+ if (!makeGlyph(c, xFrac, yFrac, &bitmap2, u)) { - return gFalse; - } - ---- splash/SplashFont.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashFont.h Fri May 7 20:20:08 2004 -@@ -61,15 +61,15 @@ - // should override this to zero out xFrac and/or yFrac if they don't - // support fractional coordinates. - virtual GBool getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u); - - // Rasterize a glyph. The <xFrac> and <yFrac> values are the same - // as described for getGlyph. - virtual GBool makeGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) = 0; -+ SplashGlyphBitmap *bitmap, Unicode *u) = 0; - - // Return the path for a glyph. -- virtual SplashPath *getGlyphPath(int c) = 0; -+ virtual SplashPath *getGlyphPath(int c, Unicode *u) = 0; - - protected: - ---- splash/SplashT1Font.cc.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashT1Font.cc Fri May 7 20:20:08 2004 -@@ -171,12 +171,12 @@ - } - - GBool SplashT1Font::getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) { -- return SplashFont::getGlyph(c, 0, 0, bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u) { -+ return SplashFont::getGlyph(c, 0, 0, bitmap, u); - } - - GBool SplashT1Font::makeGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap) { -+ SplashGlyphBitmap *bitmap, Unicode *u) { - GLYPH *glyph; - int n, i; - -@@ -209,7 +209,7 @@ - return gTrue; - } - --SplashPath *SplashT1Font::getGlyphPath(int c) { -+SplashPath *SplashT1Font::getGlyphPath(int c, Unicode *u) { - SplashPath *path; - T1_OUTLINE *outline; - T1_PATHSEGMENT *seg; ---- splash/SplashT1Font.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashT1Font.h Fri May 7 20:20:08 2004 -@@ -30,15 +30,15 @@ - - // Munge xFrac and yFrac before calling SplashFont::getGlyph. - virtual GBool getGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u); - - // Rasterize a glyph. The <xFrac> and <yFrac> values are the same - // as described for getGlyph. - virtual GBool makeGlyph(int c, int xFrac, int yFrac, -- SplashGlyphBitmap *bitmap); -+ SplashGlyphBitmap *bitmap, Unicode *u); - - // Return the path for a glyph. -- virtual SplashPath *getGlyphPath(int c); -+ virtual SplashPath *getGlyphPath(int c, Unicode *u); - - private: - ---- splash/SplashTypes.h.orig Thu Jan 22 10:26:44 2004 -+++ splash/SplashTypes.h Fri May 7 20:20:08 2004 -@@ -9,6 +9,7 @@ - - #include <aconf.h> - #include "gtypes.h" -+#include "../xpdf/CharTypes.h" - - //------------------------------------------------------------------------ - // coordinates ---- splash/SplashFTFontEngine.h.orig Fri May 7 22:52:10 2004 -+++ splash/SplashFTFontEngine.h Fri May 7 22:52:41 2004 -@@ -15,7 +15,8 @@ - #pragma interface - #endif - --#include <freetype/freetype.h> -+#include <ft2build.h> -+#include FT_FREETYPE_H - #include "gtypes.h" - - class SplashFontFile; ---- xpdf/SplashOutputDev.cc.orig Thu Jan 22 10:26:45 2004 -+++ xpdf/SplashOutputDev.cc Fri May 7 20:20:08 2004 -@@ -823,12 +823,12 @@ - - // fill - if (!(render & 1)) { -- splash->fillChar((SplashCoord)x1, (SplashCoord)y1, code, font); -+ splash->fillChar((SplashCoord)x1, (SplashCoord)y1, code, font, u); - } - - // stroke - if ((render & 3) == 1 || (render & 3) == 2) { -- if ((path = font->getGlyphPath(code))) { -+ if ((path = font->getGlyphPath(code, u))) { - path->offset((SplashCoord)x1, (SplashCoord)y1); - splash->stroke(path); - delete path; -@@ -837,7 +837,7 @@ - - // clip - if (render & 4) { -- path = font->getGlyphPath(code); -+ path = font->getGlyphPath(code, u); - path->offset((SplashCoord)x1, (SplashCoord)y1); - if (textClipPath) { - textClipPath->append(path); diff --git a/graphics/xpdf/files/patch-xfont b/graphics/xpdf/files/patch-xfont new file mode 100644 index 000000000000..1393e2640e20 --- /dev/null +++ b/graphics/xpdf/files/patch-xfont @@ -0,0 +1,11 @@ +--- xpdf/XPDFViewer.cc.orig 2004-10-12 12:24:57.055068037 +0200 ++++ xpdf/XPDFViewer.cc 2004-10-12 12:24:47.707449614 +0200 +@@ -1742,7 +1742,7 @@ + aboutBigFont = + createFontList("-*-times-bold-i-normal--20-*-*-*-*-*-iso8859-1"); + aboutVersionFont = +- createFontList("-*-times-medium-r-normal--16-*-*-*-*-*-iso8859-1"); ++ createFontList("-*-times-medium-r-normal--14-*-*-*-*-*-iso8859-1"); + aboutFixedFont = + createFontList("-*-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1"); + |