summaryrefslogtreecommitdiffstats
path: root/graphics/poppler
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-02-25 17:58:48 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-02-25 17:58:48 +0800
commite424a671c12b0f83ce46d8b19a0f99ddc5641636 (patch)
tree92d39aa77234d65aee2bcb9a5081cdd266a76ca4 /graphics/poppler
parent105ee6f8563f53928704bc0481849cc170e8de6b (diff)
downloadmarcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar.gz
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar.bz2
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar.lz
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar.xz
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.tar.zst
marcuscom-ports-e424a671c12b0f83ce46d8b19a0f99ddc5641636.zip
Fix a bug where poppler would not be able to find certain fonts (like Times
Roman). Behold "The Complete FreeBSD" in all its glory! Obtained from: Poppler CVS git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@5762 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'graphics/poppler')
-rw-r--r--graphics/poppler/Makefile6
-rw-r--r--graphics/poppler/files/patch-poppler_GlobalParams.cc76
2 files changed, 79 insertions, 3 deletions
diff --git a/graphics/poppler/Makefile b/graphics/poppler/Makefile
index c553f1e4c..f9811685a 100644
--- a/graphics/poppler/Makefile
+++ b/graphics/poppler/Makefile
@@ -3,12 +3,12 @@
# Whom: marcus@FreeBSD.org
#
# $FreeBSD$
-# $MCom: ports/graphics/poppler/Makefile,v 1.19 2006/01/13 03:17:43 ahze Exp $
+# $MCom: ports/graphics/poppler/Makefile,v 1.20 2006/02/24 18:50:35 marcus Exp $
#
PORTNAME= poppler
PORTVERSION= 0.5.0
-PORTREVISION?= 1
+PORTREVISION?= 2
CATEGORIES= graphics print
MASTER_SITES= http://poppler.freedesktop.org/
@@ -21,7 +21,7 @@ CONFLICTS= xpdf-[0-9]*
USE_GMAKE= yes
USE_X_PREFIX= yes
GNU_CONFIGURE= yes
-USE_GNOME= gnomehack
+USE_GNOME= gnomehack gnometarget
INSTALLS_SHLIB= yes
CONFIGURE_ARGS= --enable-zlib \
--enable-xpdf-headers \
diff --git a/graphics/poppler/files/patch-poppler_GlobalParams.cc b/graphics/poppler/files/patch-poppler_GlobalParams.cc
new file mode 100644
index 000000000..efade0562
--- /dev/null
+++ b/graphics/poppler/files/patch-poppler_GlobalParams.cc
@@ -0,0 +1,76 @@
+--- poppler/GlobalParams.cc.orig Sat Feb 25 04:48:29 2006
++++ poppler/GlobalParams.cc Sat Feb 25 04:55:02 2006
+@@ -1266,7 +1266,7 @@ FcPattern *buildFcPattern(GfxFont *font)
+
+ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
+ DisplayFontParam *dfp;
+- FcPattern *p=0,*m=0;
++ FcPattern *p=0;
+
+ GooString *fontName = font->getName();
+ if (!fontName) return NULL;
+@@ -1278,38 +1278,43 @@ DisplayFontParam *GlobalParams::getDispl
+ FcChar8* s;
+ char * ext;
+ FcResult res;
++ FcFontSet *set;
++ int i;
+ p = buildFcPattern(font);
+
+ if (!p)
+ goto fin;
+ FcConfigSubstitute(FCcfg, p, FcMatchPattern);
+ FcDefaultSubstitute(p);
+- m = FcFontMatch(FCcfg,p,&res);
+- if (!m)
+- goto fin;
+- res = FcPatternGetString(m, FC_FILE, 0, &s);
+- if (res != FcResultMatch || !s)
+- goto fin;
+- ext = strrchr((char*)s,'.');
+- if (!ext)
++ set = FcFontSort(FCcfg, p, FcFalse, NULL, &res);
++ if (!set)
+ goto fin;
+- if (!strncasecmp(ext,".ttf",4))
++ for (i = 0; i < set->nfont; ++i)
+ {
+- dfp = new DisplayFontParam(fontName->copy(), displayFontTT);
+- dfp->tt.fileName = new GooString((char*)s);
++ res = FcPatternGetString(set->fonts[i], FC_FILE, 0, &s);
++ if (res != FcResultMatch || !s)
++ continue;
++ ext = strrchr((char*)s,'.');
++ if (!ext)
++ continue;
++ if (!strncasecmp(ext,".ttf",4) || !strncasecmp(ext, ".ttc", 4))
++ {
++ dfp = new DisplayFontParam(fontName->copy(), displayFontTT);
++ dfp->tt.fileName = new GooString((char*)s);
++ }
++ else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4))
++ {
++ dfp = new DisplayFontParam(fontName->copy(), displayFontT1);
++ dfp->t1.fileName = new GooString((char*)s);
++ }
++ else
++ continue;
++ displayFonts->add(dfp->name,dfp);
++ break;
+ }
+- else if (!strncasecmp(ext,".pfa",4) || !strncasecmp(ext,".pfb",4))
+- {
+- dfp = new DisplayFontParam(fontName->copy(), displayFontT1);
+- dfp->t1.fileName = new GooString((char*)s);
+- }
+- else
+- goto fin;
+- displayFonts->add(dfp->name,dfp);
++ FcFontSetDestroy(set);
+ }
+ fin:
+- if (m)
+- FcPatternDestroy(m);
+ if (p)
+ FcPatternDestroy(p);
+