[poppler] poppler/qt4/src: poppler-document.cc, 1.14, 1.15 poppler-fontinfo.cc, 1.3, 1.4 poppler-private.h, 1.4, 1.5 poppler-qt4.h, 1.24, 1.25

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Mar 11 07:19:05 PST 2006


Update of /cvs/poppler/poppler/qt4/src
In directory kemper:/tmp/cvs-serv23798/qt4/src

Modified Files:
	poppler-document.cc poppler-fontinfo.cc poppler-private.h 
	poppler-qt4.h 
Log Message:
* poppler/FontInfo.cc:
* poppler/FontInfo.h: Add getFile() function that returns
the path of the font that is beign used in the system to
represent that font
* qt4/src/poppler-document.cc:
* qt4/src/poppler-fontinfo.cc:
* qt4/src/poppler-private.h:
* qt4/src/poppler-qt4.h: Add the file() function
* qt4/tests/poppler-fonts.cpp: Show the path of the font
used to represent each font

May be interesting to have in the other frontends



Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-document.cc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- poppler-document.cc	18 Jan 2006 22:32:13 -0000	1.14
+++ poppler-document.cc	11 Mar 2006 15:19:02 -0000	1.15
@@ -27,7 +27,6 @@
 #include <Catalog.h>
 #include "UGooString.h"
 #include <ErrorCodes.h>
-#include <SplashOutputDev.h>
 #include <splash/SplashBitmap.h>
 #include "poppler-private.h"
 #include <Stream.h>
@@ -175,18 +174,7 @@
 	    return false;
 
 	for ( int i = 0; i < items->getLength(); ++i ) {
-	    if (((::FontInfo*)items->get(i))->getName())
-		fontList->append(FontInfo(((::FontInfo*)items->get(i))->getName()->getCString(),
-			      ((::FontInfo*)items->get(i))->getEmbedded(),
-			      ((::FontInfo*)items->get(i))->getSubset(),
-			      (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()
-		));
-	    else
-		fontList->append(FontInfo(QString::null,
-			      ((::FontInfo*)items->get(i))->getEmbedded(),
-			      ((::FontInfo*)items->get(i))->getSubset(),
-			      (Poppler::FontInfo::Type)((::FontInfo*)items->get(i))->getType()
-		));
+	    fontList->append( FontInfo(FontInfoData((::FontInfo*)items->get(i))) );
 	}
 	deleteGooList(items, ::FontInfo);
 	return true;

Index: poppler-fontinfo.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-fontinfo.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- poppler-fontinfo.cc	4 Dec 2005 11:30:00 -0000	1.3
+++ poppler-fontinfo.cc	11 Mar 2006 15:19:02 -0000	1.4
@@ -20,34 +20,18 @@
 #define UNSTABLE_POPPLER_QT4
 
 #include "poppler-qt4.h"
+#include "poppler-private.h"
 
 namespace Poppler {
 
-class FontInfoData
-{
-	public:
-		QString fontName;
-		bool isEmbedded;
-		bool isSubset;
-		FontInfo::Type type;
-};
-
-FontInfo::FontInfo( const QString &fontName, const bool isEmbedded, const bool isSubset, Type type )
+FontInfo::FontInfo( const FontInfoData &fid )
 {
-	m_data = new FontInfoData();
-	m_data->fontName = fontName;
-	m_data->isEmbedded = isEmbedded;
-	m_data->isSubset = isSubset;
-	m_data->type = type;
+	m_data = new FontInfoData(fid);
 }
 
 FontInfo::FontInfo( const FontInfo &fi )
 {
-	m_data = new FontInfoData();
-	m_data->fontName = fi.m_data->fontName;
-	m_data->isEmbedded = fi.m_data->isEmbedded;
-	m_data->isSubset = fi.m_data->isSubset;
-	m_data->type = fi.m_data->type;
+	m_data = new FontInfoData(*fi.m_data);
 }
 
 FontInfo::~FontInfo()
@@ -60,6 +44,11 @@
 	return m_data->fontName;
 }
 
+const QString &FontInfo::file() const
+{
+	return m_data->fontFile;
+}
+
 bool FontInfo::isEmbedded() const
 {
 	return m_data->isEmbedded;

Index: poppler-private.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-private.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- poppler-private.h	18 Jan 2006 22:32:13 -0000	1.4
+++ poppler-private.h	11 Mar 2006 15:19:02 -0000	1.5
@@ -19,6 +19,7 @@
 #include <PDFDoc.h>
 #include <GfxState.h>
 #include <FontInfo.h>
+#include <SplashOutputDev.h>
 
 namespace Poppler {
 
@@ -60,6 +61,34 @@
 	QList<EmbeddedFile*> m_embeddedFiles;
     };
 
+    class FontInfoData
+    {
+	public:
+		FontInfoData( const FontInfoData &fid )
+		{
+			fontName = fid.fontName;
+			fontFile = fid.fontFile;
+			isEmbedded = fid.isEmbedded;
+			isSubset = fid.isSubset;
+			type = fid.type;
+		}
+		
+		FontInfoData( ::FontInfo* fi )
+		{
+			if (fi->getName()) fontName = fi->getName()->getCString();
+			if (fi->getFile()) fontFile = fi->getFile()->getCString();
+			isEmbedded = fi->getEmbedded();
+			isSubset = fi->getSubset();
+			type = (Poppler::FontInfo::Type)fi->getType();
+		}
+
+		QString fontName;
+		QString fontFile;
+		bool isEmbedded;
+		bool isSubset;
+		FontInfo::Type type;
+    };
+
 }
 
 

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- poppler-qt4.h	18 Jan 2006 22:32:13 -0000	1.24
+++ poppler-qt4.h	11 Mar 2006 15:19:02 -0000	1.25
@@ -96,8 +96,7 @@
 	/**
 	   Create a new font information container
 	*/
-	FontInfo( const QString &fontName, const bool isEmbedded,
-		  const bool isSubset, Type type);
+	FontInfo( const FontInfoData &fid );
 	
 	FontInfo( const FontInfo &fi );
 	
@@ -109,6 +108,11 @@
 	const QString &name() const;
 
 	/**
+	   The path of the font file used to represent this font on this system.
+	*/
+	const QString &file() const;
+
+	/**
 	   Whether the font is embedded in the file, or not
 
 	   \return true if the font is embedded



More information about the poppler mailing list