summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glib/poppler-document.cc3
-rw-r--r--poppler/CairoFontEngine.cc2
-rw-r--r--poppler/CairoFontEngine.h3
-rw-r--r--poppler/CairoOutputDev.cc7
-rw-r--r--poppler/CairoOutputDev.h3
-rw-r--r--test/pdf-inspector.cc2
6 files changed, 13 insertions, 7 deletions
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 7637af49..ef5deb0b 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -106,14 +106,15 @@ _poppler_document_new_from_pdfdoc (PDFDoc *newDoc,
#if defined (HAVE_CAIRO)
document->output_dev = new CairoOutputDev ();
+ document->output_dev->startDoc(document->doc->getXRef (), document->doc->getCatalog ());
#elif defined (HAVE_SPLASH)
SplashColor white;
white[0] = 255;
white[1] = 255;
white[2] = 255;
document->output_dev = new SplashOutputDev(splashModeRGB8, 4, gFalse, white);
-#endif
document->output_dev->startDoc(document->doc->getXRef ());
+#endif
return document;
}
diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index 61e00a37..75340b82 100644
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -561,7 +561,7 @@ CairoFontEngine::~CairoFontEngine() {
}
CairoFont *
-CairoFontEngine::getFont(GfxFont *gfxFont, XRef *xref) {
+CairoFontEngine::getFont(GfxFont *gfxFont, XRef *xref, Catalog *catalog) {
int i, j;
Ref ref;
CairoFont *font;
diff --git a/poppler/CairoFontEngine.h b/poppler/CairoFontEngine.h
index 8b7a99fd..1f25026d 100644
--- a/poppler/CairoFontEngine.h
+++ b/poppler/CairoFontEngine.h
@@ -35,6 +35,7 @@
#include <cairo-ft.h>
#include "GfxFont.h"
+#include "Catalog.h"
class CairoFont {
public:
@@ -89,7 +90,7 @@ public:
CairoFontEngine(FT_Library libA);
~CairoFontEngine();
- CairoFont *getFont(GfxFont *gfxFont, XRef *xref);
+ CairoFont *getFont(GfxFont *gfxFont, XRef *xref, Catalog *catalog);
private:
CairoFont *fontCache[cairoFontCacheSize];
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 25335b75..eec5167d 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -107,6 +107,7 @@ GBool CairoOutputDev::ft_lib_initialized = gFalse;
CairoOutputDev::CairoOutputDev() {
xref = NULL;
+ catalog = NULL;
if (!ft_lib_initialized) {
FT_Init_FreeType(&ft_lib);
@@ -172,8 +173,10 @@ void CairoOutputDev::setCairo(cairo_t *cairo)
}
}
-void CairoOutputDev::startDoc(XRef *xrefA, CairoFontEngine *parentFontEngine) {
+void CairoOutputDev::startDoc(XRef *xrefA, Catalog *catalogA,
+ CairoFontEngine *parentFontEngine) {
xref = xrefA;
+ catalog = catalogA;
if (parentFontEngine) {
fontEngine = parentFontEngine;
} else {
@@ -414,7 +417,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
if (state->getFont()->getType() == fontType3)
return;
- currentFont = fontEngine->getFont (state->getFont(), xref);
+ currentFont = fontEngine->getFont (state->getFont(), xref, catalog);
if (!currentFont)
return;
diff --git a/poppler/CairoOutputDev.h b/poppler/CairoOutputDev.h
index 27b39ed2..d70740d1 100644
--- a/poppler/CairoOutputDev.h
+++ b/poppler/CairoOutputDev.h
@@ -207,7 +207,7 @@ public:
//----- special access
// Called to indicate that a new PDF document has been loaded.
- void startDoc(XRef *xrefA, CairoFontEngine *fontEngine = NULL);
+ void startDoc(XRef *xrefA, Catalog *catalogA, CairoFontEngine *fontEngine = NULL);
GBool isReverseVideo() { return gFalse; }
@@ -224,6 +224,7 @@ protected:
CairoFont *currentFont;
XRef *xref; // xref table for current document
+ Catalog *catalog;
static FT_Library ft_lib;
static GBool ft_lib_initialized;
diff --git a/test/pdf-inspector.cc b/test/pdf-inspector.cc
index 3965380e..3eb86500 100644
--- a/test/pdf-inspector.cc
+++ b/test/pdf-inspector.cc
@@ -292,7 +292,7 @@ PdfInspector::load(const char *file_name)
gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin), 0, doc->getNumPages()-1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), 0);
- output->startDoc (doc->getXRef());
+ output->startDoc (doc->getXRef(), doc->getCatalog());
}
else
{