Commit 774a9456 authored by Jeff Muizelaar's avatar Jeff Muizelaar

2007-05-25 Jeff Muizelaar <jeff@infidigm.net>

	* poppler/GfxFont.cc:
	* poppler/GfxFont.h:
	* poppler/GlobalParams.cc:
	Don't cache DisplayFontParams by font name, instead cache them
	in GfxFont. Fixes #8140.
parent a88fadf0
2007-05-25 Jeff Muizelaar <jeff@infidigm.net>
* poppler/GfxFont.cc:
* poppler/GfxFont.h:
* poppler/GlobalParams.cc:
Don't cache DisplayFontParams by font name, instead cache them
in GfxFont. Fixes #8140.
2007-05-25 Carlos Garcia Campos <carlosgc@gnome.org>
* glib/poppler-page.cc:
......
......@@ -148,6 +148,7 @@ GfxFont::GfxFont(char *tagA, Ref idA, GooString *nameA) {
stretch = StretchNotDefined;
weight = WeightNotDefined;
refCnt = 1;
dfp = NULL;
}
GfxFont::~GfxFont() {
......@@ -165,6 +166,7 @@ GfxFont::~GfxFont() {
if (extFontFile) {
delete extFontFile;
}
delete dfp;
}
void GfxFont::incRefCnt() {
......
......@@ -22,6 +22,7 @@ class Dict;
class CMap;
class CharCodeToUnicode;
class FoFiTrueType;
class DisplayFontParam;
struct GfxFontCIDWidths;
//------------------------------------------------------------------------
......@@ -202,6 +203,11 @@ public:
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);
......
......@@ -1081,7 +1081,7 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
if (!fontName) return NULL;
lockGlobalParams;
dfp = (DisplayFontParam *)displayFonts->lookup(fontName);
dfp = font->dfp;
if (!dfp)
{
FcChar8* s;
......@@ -1119,7 +1119,7 @@ DisplayFontParam *GlobalParams::getDisplayFont(GfxFont *font) {
}
else
continue;
displayFonts->add(dfp->name,dfp);
font->dfp = dfp;
break;
}
FcFontSetDestroy(set);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment