[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-sections.txt | 1 +
3 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index bf83bf0..73bf949 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 *file;
+ FontInfo *info;
+
+ info = (FontInfo *)iter->items->get (iter->index);
+
+ file = info->getSubstituteName();
+ if (file != NULL) {
+ return file->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..4049487 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-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
--------------010703010206000408000202
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