diff options
author | Brad Hards <bradh@frogmouth.net> | 2005-07-04 08:16:17 +0000 |
---|---|---|
committer | Brad Hards <bradh@frogmouth.net> | 2005-07-04 08:16:17 +0000 |
commit | d42998d0fc32b1e21a2aeef1311e0baf508ade3f (patch) | |
tree | 027dfb128481b31a6a9cdbf06cc53986cdbd36d3 /qt4/src | |
parent | 5d194b926d1ed642ed4bbd3304befa073d389cd4 (diff) |
Qt4 update.
* qt4/src/poppler-qt4.h:
* qt4/src/poppler-document.cc complete Qt4 font metadata handling
* qt4/src/poppler-qt4.h:
* qt4/src/poppler-page.cc: change the render API to make it more
Qt-like.
Diffstat (limited to 'qt4/src')
-rw-r--r-- | qt4/src/poppler-document.cc | 7 | ||||
-rw-r--r-- | qt4/src/poppler-page.cc | 5 | ||||
-rw-r--r-- | qt4/src/poppler-qt4.h | 73 |
3 files changed, 77 insertions, 8 deletions
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc index cf5f9155..28f4ae77 100644 --- a/qt4/src/poppler-document.cc +++ b/qt4/src/poppler-document.cc @@ -130,7 +130,12 @@ namespace Poppler { return false; for ( int i = 0; i < items->getLength(); ++i ) { - FontInfo thisFont(((::FontInfo*)items->get(i))->getName()->getCString()); + FontInfo thisFont(((::FontInfo*)items->get(i))->getName()->getCString(), + ((::FontInfo*)items->get(i))->getEmbedded(), + ((::FontInfo*)items->get(i))->getSubset(), + ((::FontInfo*)items->get(i))->getToUnicode(), + (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType() + ); fontList->append(thisFont); } return true; diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc index 0980fdd4..a994083c 100644 --- a/qt4/src/poppler-page.cc +++ b/qt4/src/poppler-page.cc @@ -76,10 +76,9 @@ void Page::splashRenderToPixmap(QPixmap **q, int x, int y, int w, int h) const delete output_dev; } -void Page::renderToPixmap(QPixmap **pixmap, QSize size) const +void Page::renderToPixmap(QPixmap *pixmap) const { - *pixmap = new QPixmap(size); - QPainter* painter = new QPainter(*pixmap); + QPainter* painter = new QPainter(pixmap); painter->setRenderHint(QPainter::Antialiasing); ArthurOutputDev output_dev(painter); diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h index b9a404be..32dea650 100644 --- a/qt4/src/poppler-qt4.h +++ b/qt4/src/poppler-qt4.h @@ -42,20 +42,75 @@ namespace Poppler { */ class FontInfo { public: + enum Type { + unknown, + Type1, + Type1C, + Type3, + TrueType, + CIDType0, + CIDType0C, + CIDTrueType + }; + /** Create a new font information container */ - FontInfo( const QString fontName ): - m_fontName(fontName) {}; + FontInfo( const QString fontName, const bool isEmbedded, + const bool isSubset, const bool requiresUnicodeConversion, + Type type): + m_fontName(fontName), + m_isEmbedded(isEmbedded), + m_isSubset(isSubset), + m_requiresUnicodeConversion(requiresUnicodeConversion), + m_type(type) + {}; /** The name of the font */ QString name() const { return m_fontName; } - + + /** + Whether the font is embedded in the file, or not + + \return true if the font is embedded + */ + bool isEmbedded() const + { return m_isEmbedded; } + + /** + Whether the font provided is only a subset of the full + font or not. This only has meaning if the font is embedded. + + \return true if the font is only a subset + */ + bool isSubset() const + { return m_isSubset; } + + /** + Whether the font requires special (table) lookup + + \return true if the codepoints need to be looked up to get + to a Unicode form + */ + bool requiresUnicodeConversion() const + { return m_requiresUnicodeConversion; } + + /** + The type of font encoding + */ + Type type() const + { return m_type; } + + QString typeName() const; private: QString m_fontName; + bool m_isEmbedded; + bool m_isSubset; + bool m_requiresUnicodeConversion; + Type m_type; }; @@ -74,8 +129,18 @@ namespace Poppler { /** Render the page to a pixmap using the Arthur (Qt4) renderer + + \param q pointer to a QPixmap that is already set to the + intended size. + + You are meant to create the pixmap before passing it to + this routine, using something like: + \code + QPixmap* myPixmap = new QPixmap(page->pageSize()); + page->renderToPixmap(myPixmap); + \endcode */ - void renderToPixmap(QPixmap **q, QSize size) const; + void renderToPixmap(QPixmap *q) const; /** Returns the text that is inside a specified rectangle |