[poppler] poppler/qt4/src: Mainpage.dox, 1.1, 1.2 poppler-fontinfo.cc, 1.1, 1.2 poppler-qt4.h, 1.13, 1.14

Brad Hards bradh at freedesktop.org
Sun Dec 4 02:05:24 PST 2005


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

Modified Files:
	Mainpage.dox poppler-fontinfo.cc poppler-qt4.h 
Log Message:
* qt4/src/poppler-qt4.h:
  qt4/src/fontinfo.cc: add implementation for FontInfo::typeName()

* qt4/tests/check_fonts.cpp:
* qt4/tests/Makefile.am: add unit test for fonts

* qt4/src/Mainpage.dox: Minor typo fixes.



Index: Mainpage.dox
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/Mainpage.dox,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Mainpage.dox	3 Dec 2005 21:35:46 -0000	1.1
+++ Mainpage.dox	4 Dec 2005 10:05:21 -0000	1.2
@@ -1,7 +1,7 @@
 /**
 @mainpage The Poppler Qt4 interface library
 
-The Poppler Qt4 interface library, libpoppler-qt4, is library that
+The Poppler Qt4 interface library, libpoppler-qt4, is a library that
 allows Qt4 programmers to easily load and render PDF files. The
 Poppler Qt4 interface library uses poppler internally to do its job,
 but the Qt4 programmer will never have to worry about poppler
@@ -38,7 +38,8 @@
 @endcode
 
 The #define statement is required at the moment. You indicate that you
-think you know what you are doing.
+think you know what you are doing, and understand that the API is
+subject to change.
 
 A PDF document can then be loaded as follows.
 @code

Index: poppler-fontinfo.cc
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-fontinfo.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- poppler-fontinfo.cc	3 Dec 2005 22:20:54 -0000	1.1
+++ poppler-fontinfo.cc	4 Dec 2005 10:05:21 -0000	1.2
@@ -66,4 +66,28 @@
 	return m_data->type;
 }
 
+const QString FontInfo::typeName() const
+{
+	switch (type()) {
+	case unknown:
+		return QObject::tr("unknown");
+	case Type1:
+		return QObject::tr("Type 1");
+	case Type1C:
+		return QObject::tr("Type 1C");
+	case Type3:
+		return QObject::tr("Type 3");
+	case TrueType:
+		return QObject::tr("TrueType");
+	case CIDType0:
+		return QObject::tr("CID Type 0");
+	case CIDType0C:
+		return QObject::tr("CID Type 0C");
+	case CIDTrueType:
+		return QObject::tr("CID TrueType");
+	default:
+		return QObject::tr("Bug: unexpected font type. Notify poppler mailing list!");
+	}
+}
+
 }

Index: poppler-qt4.h
===================================================================
RCS file: /cvs/poppler/poppler/qt4/src/poppler-qt4.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- poppler-qt4.h	3 Dec 2005 22:20:54 -0000	1.13
+++ poppler-qt4.h	4 Dec 2005 10:05:21 -0000	1.14
@@ -96,10 +96,22 @@
 
 	/**
 	   The type of font encoding
+
+	   \return a enumerated value corresponding to the font encoding used
+
+	   \sa typeName for a string equivalent
 	*/
 	Type type() const;
 
-	const QString &typeName() const;
+	/**
+	   The name of the font encoding used
+
+	   \note if you are looking for the name of the font (as opposed to the
+	   encoding format used), you probably want name().
+
+	   \sa type for a enumeration version
+	*/
+	const QString typeName() const;
 
     private:
 	FontInfoData *m_data;



More information about the poppler mailing list