[poppler] 0.6 Release Candidate

Jeff Muizelaar jeff at infidigm.net
Mon May 21 20:10:00 PDT 2007


On Sun, May 20, 2007 at 10:40:23PM +0200, Albert Astals Cid wrote:
> Hi, on the last mail i sent about 0.6, we set 26th May as release date for 0.6 
> Release Candidate.
> 
> What's your opinion on releasing current poppler as Release Candidate?
> 
> Anything you want to include and you may need some more time to get it 
> included?

It would also be nice to include a fix for:
https://bugs.freedesktop.org/show_bug.cgi?id=8140

Albert, what do you think of the following patch? It isn't pretty but it
does get the job done. It should be possible to do more cleanup later.

The disadvantage of this approach is that font lookups are not cached across
renderings of different pdfs. However, this is arguably saner.

Index: poppler/GfxFont.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/GfxFont.cc,v
retrieving revision 1.11
diff -u -r1.11 GfxFont.cc
--- poppler/GfxFont.cc	25 Apr 2007 19:59:10 -0000	1.11
+++ poppler/GfxFont.cc	14 May 2007 01:30:43 -0000
@@ -148,6 +148,7 @@
   stretch = StretchNotDefined;
   weight = WeightNotDefined;
   refCnt = 1;
+  dfp = NULL;
 }
 
 GfxFont::~GfxFont() {
@@ -165,6 +166,7 @@
   if (extFontFile) {
     delete extFontFile;
   }
+  delete dfp;
 }
 
 void GfxFont::incRefCnt() {
Index: poppler/GfxFont.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/GfxFont.h,v
retrieving revision 1.6
diff -u -r1.6 GfxFont.h
--- poppler/GfxFont.h	25 Apr 2007 19:59:10 -0000	1.6
+++ poppler/GfxFont.h	14 May 2007 01:30:43 -0000
@@ -22,6 +22,7 @@
 class CMap;
 class CharCodeToUnicode;
 class FoFiTrueType;
+class DisplayFontParam;
 struct GfxFontCIDWidths;
 
 //------------------------------------------------------------------------
@@ -202,6 +203,11 @@
 			  Unicode *u, int uSize, int *uLen,
 			  double *dx, double *dy, double *ox, double *oy) = 0;
 
+  /* XXX: dfp shouldn't be public, however the font finding code is currently in
+   * GlobalParams. Instead it should be inside the GfxFont class. However,
+   * getDisplayFont currently uses FCcfg so moving it is not as simple. */
+  /* XXX: related to this is the fact that all of the extFontFile stuff is dead */
+  DisplayFontParam *dfp;
 protected:
 
   void readFontDescriptor(XRef *xref, Dict *fontDict);
Index: poppler/GlobalParams.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/GlobalParams.cc,v
retrieving revision 1.21
diff -u -r1.21 GlobalParams.cc
--- poppler/GlobalParams.cc	28 Apr 2007 15:39:36 -0000	1.21
+++ poppler/GlobalParams.cc	14 May 2007 01:30:46 -0000
@@ -1081,7 +1081,7 @@
   if (!fontName) return NULL;
   
   lockGlobalParams;
-  dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
+  dfp = font->dfp;
   if (!dfp)
   {
     FcChar8* s;
@@ -1119,7 +1119,7 @@
       }
       else
         continue;
-      displayFonts->add(dfp->name,dfp);
+      font->dfp = dfp;
       break;
     }
     FcFontSetDestroy(set);


More information about the poppler mailing list