[poppler] poppler/qt4/src: poppler-document.cc, 1.1, 1.2 poppler-page.cc, 1.1, 1.2 poppler-qt4.h, 1.1, 1.2

Brad Hards bradh at freedesktop.org
Mon Jul 4 01:16:19 PDT 2005


Update of /cvs/poppler/poppler/qt4/src
In directory gabe:/tmp/cvs-serv10248

Modified Files:
	poppler-document.cc poppler-page.cc poppler-qt4.h 
Log Message:
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.


Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-document.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poppler-document.cc	28 Jun 2005 10:00:09 -0000	1.1
+++ poppler-document.cc	4 Jul 2005 08:16:17 -0000	1.2
@@ -130,7 +130,12 @@
 	    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;

Index: poppler-page.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-page.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poppler-page.cc	28 Jun 2005 10:00:09 -0000	1.1
+++ poppler-page.cc	4 Jul 2005 08:16:17 -0000	1.2
@@ -76,10 +76,9 @@
   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);
 

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poppler-qt4.h	28 Jun 2005 10:00:09 -0000	1.1
+++ poppler-qt4.h	4 Jul 2005 08:16:17 -0000	1.2
@@ -42,20 +42,75 @@
     */
     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 @@
 
 	/**
 	   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



More information about the poppler mailing list