[PATCH 1/3] glib: add poppler_fonts_iter_get_substitute_name

Adrian Johnson ajohnson at redneon.com
Tue Feb 28 02:36:38 PST 2012


---
 glib/poppler-document.cc            |   27 +++++++++++++++++++++++++++
 glib/poppler-document.h             |    1 +
 glib/reference/poppler-docs.sgml    |    4 ++++
 glib/reference/poppler-sections.txt |    1 +
 4 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index bf83bf0..59124b5 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -1716,6 +1716,33 @@ poppler_fonts_iter_get_name (PopplerFontsIter *iter)
 }
 
 /**
+ * poppler_fonts_iter_get_substitute_name:
+ * @iter: a #PopplerFontsIter
+ *
+ * The name of the substitute font of the font associated with @iter or %NULL if
+ * the font is embedded
+ *
+ * Returns: the name of the substitute font or %NULL y font is emebedded
+ *
+ * Since: 0.20
+ */
+const char *
+poppler_fonts_iter_get_substitute_name (PopplerFontsIter *iter)
+{
+	GooString *name;
+	FontInfo *info;
+
+	info = (FontInfo *)iter->items->get (iter->index);
+
+	name = info->getSubstituteName();
+	if (name != NULL) {
+		return name->getCString();
+	} else {
+		return NULL;
+	}
+}
+
+/**
  * poppler_fonts_iter_get_file_name:
  * @iter: a #PopplerFontsIter
  *
diff --git a/glib/poppler-document.h b/glib/poppler-document.h
index 4ab17c8..d29ef6b 100644
--- a/glib/poppler-document.h
+++ b/glib/poppler-document.h
@@ -246,6 +246,7 @@ PopplerFontsIter *poppler_fonts_iter_copy          (PopplerFontsIter  *iter);
 void              poppler_fonts_iter_free          (PopplerFontsIter  *iter);
 const char       *poppler_fonts_iter_get_name      (PopplerFontsIter  *iter);
 const char       *poppler_fonts_iter_get_full_name (PopplerFontsIter  *iter);
+const char       *poppler_fonts_iter_get_substitute_name (PopplerFontsIter *iter);
 const char       *poppler_fonts_iter_get_file_name (PopplerFontsIter  *iter);
 PopplerFontType   poppler_fonts_iter_get_font_type (PopplerFontsIter  *iter);
 gboolean	  poppler_fonts_iter_is_embedded   (PopplerFontsIter  *iter);
diff --git a/glib/reference/poppler-docs.sgml b/glib/reference/poppler-docs.sgml
index 390ae67..d15bd18 100644
--- a/glib/reference/poppler-docs.sgml
+++ b/glib/reference/poppler-docs.sgml
@@ -50,6 +50,10 @@
     <title>Index of new symbols in 0.18</title>
     <xi:include href="xml/api-index-0.18.xml"><xi:fallback /></xi:include>
   </index>
+  <index id="api-index-0-20">
+    <title>Index of new symbols in 0.20</title>
+    <xi:include href="xml/api-index-0.20.xml"><xi:fallback /></xi:include>
+  </index>
 
   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
 </book>
diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt
index c2759b8..08df585 100644
--- a/glib/reference/poppler-sections.txt
+++ b/glib/reference/poppler-sections.txt
@@ -156,6 +156,7 @@ poppler_fonts_iter_free
 poppler_fonts_iter_get_name
 poppler_fonts_iter_get_full_name
 poppler_fonts_iter_get_font_type
+poppler_fonts_iter_get_substitute_name
 poppler_fonts_iter_get_file_name
 poppler_fonts_iter_is_embedded
 poppler_fonts_iter_is_subset
-- 
1.7.5.4


--------------040904090202000503090705
Content-Type: text/x-patch;
 name="0002-glib-show-substitute-font-name-in-demo.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0002-glib-show-substitute-font-name-in-demo.patch"



More information about the poppler mailing list