[poppler] 2 commits - qt4/src splash/SplashFTFont.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Sat Oct 16 07:09:33 PDT 2010
qt4/src/poppler-ps-converter.cc | 16 ++++++++++++++--
qt4/src/poppler-qt4.h | 10 ++++++++++
splash/SplashFTFont.cc | 4 ----
3 files changed, 24 insertions(+), 6 deletions(-)
New commits:
commit 0b3b2ebc3930bd46fb13fb2158fc695b0962f7c5
Author: Albert Astals Cid <aacid at kde.org>
Date: Sat Oct 16 15:09:05 2010 +0100
Add a callback to know which page has been printed
diff --git a/qt4/src/poppler-ps-converter.cc b/qt4/src/poppler-ps-converter.cc
index 7a1957b..f39673d 100644
--- a/qt4/src/poppler-ps-converter.cc
+++ b/qt4/src/poppler-ps-converter.cc
@@ -1,5 +1,5 @@
/* poppler-ps-converter.cc: qt interface to poppler
- * Copyright (C) 2007, 2009, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2007, 2009, 2010, Albert Astals Cid <aacid at kde.org>
* Copyright (C) 2008, Pino Toscano <pino at kde.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -48,13 +48,16 @@ class PSConverterPrivate : public BaseConverterPrivate
int marginLeft;
int marginTop;
PSConverter::PSOptions opts;
+ void (* pageConvertedCallback)(int page, void *payload);
+ void *pageConvertedPayload;
};
PSConverterPrivate::PSConverterPrivate()
: BaseConverterPrivate(),
hDPI(72), vDPI(72), rotate(0), paperWidth(-1), paperHeight(-1),
marginRight(0), marginBottom(0), marginLeft(0), marginTop(0),
- opts(PSConverter::Printing)
+ opts(PSConverter::Printing), pageConvertedCallback(0),
+ pageConvertedPayload(0)
{
}
@@ -166,6 +169,13 @@ PSConverter::PSOptions PSConverter::psOptions() const
return d->opts;
}
+void PSConverter::setPageConvertedCallback(void (* callback)(int page, void *payload), void *payload)
+{
+ Q_D(PSConverter);
+ d->pageConvertedCallback = callback;
+ d->pageConvertedPayload = payload;
+}
+
bool PSConverter::convert()
{
Q_D(PSConverter);
@@ -222,6 +232,8 @@ bool PSConverter::convert()
foreach(int page, d->pageList)
{
d->document->doc->displayPage(psOut, page, d->hDPI, d->vDPI, d->rotate, gFalse, gTrue, isPrinting);
+ if (d->pageConvertedCallback)
+ (*d->pageConvertedCallback)(page, d->pageConvertedPayload);
}
delete psOut;
d->closeDevice();
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index 8a79a2a..d742973 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -1411,6 +1411,7 @@ height = dummy.height();
\since 0.10
*/
void setPSOptions(PSOptions options);
+
/**
The currently set options for the PS export.
@@ -1420,6 +1421,15 @@ height = dummy.height();
*/
PSOptions psOptions() const;
+ /**
+ Sets a function that will be called each time a page is converted.
+
+ The payload belongs to the caller.
+
+ \since 0.16
+ */
+ void setPageConvertedCallback(void (* callback)(int page, void *payload), void *payload);
+
bool convert();
private:
commit 4bd25223c4d15dfa91965a6e86eaa444a5a81f71
Author: Albert Astals Cid <aacid at kde.org>
Date: Sat Oct 16 15:08:05 2010 +0100
Do not omit this character
Mimics Cairo backend and Adode Reader behaviour
diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index 9dd0c9c..4516297 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -199,10 +199,6 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac,
} else {
gid = (FT_UInt)c;
}
- if (ff->trueType && gid == 0) {
- // skip the TrueType notdef glyph
- return gFalse;
- }
if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(aa, enableFreeTypeHinting))) {
return gFalse;
More information about the poppler
mailing list