From 62bfe50028fcf731a4f833f711816823aa5587a0 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 4 Mar 2012 17:49:56 +1030 Subject: [PATCH 1/3] glib: add poppler_fonts_iter_get_encoding --- glib/poppler-document.cc | 26 ++++++++++++++++++++++++++ glib/poppler-document.h | 1 + glib/reference/poppler-sections.txt | 1 + 3 files changed, 28 insertions(+), 0 deletions(-) diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc index 59124b5..c6108d4 100644 --- a/glib/poppler-document.cc +++ b/glib/poppler-document.cc @@ -1788,6 +1788,32 @@ poppler_fonts_iter_get_font_type (PopplerFontsIter *iter) } /** + * poppler_fonts_iter_get_encoding: + * @iter: a #PopplerFontsIter + * + * Returns the encoding of the font associated with @iter + * + * Returns: the font encoding + * + * Since: 0.20 + */ +const char * +poppler_fonts_iter_get_encoding (PopplerFontsIter *iter) +{ + GooString *encoding; + FontInfo *info; + + info = (FontInfo *)iter->items->get (iter->index); + + encoding = info->getEncoding(); + if (encoding != NULL) { + return encoding->getCString(); + } else { + return NULL; + } +} + +/** * poppler_fonts_iter_is_embedded: * @iter: a #PopplerFontsIter * diff --git a/glib/poppler-document.h b/glib/poppler-document.h index d29ef6b..7051830 100644 --- a/glib/poppler-document.h +++ b/glib/poppler-document.h @@ -249,6 +249,7 @@ 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); +const char *poppler_fonts_iter_get_encoding (PopplerFontsIter *iter); gboolean poppler_fonts_iter_is_embedded (PopplerFontsIter *iter); gboolean poppler_fonts_iter_is_subset (PopplerFontsIter *iter); gboolean poppler_fonts_iter_next (PopplerFontsIter *iter); diff --git a/glib/reference/poppler-sections.txt b/glib/reference/poppler-sections.txt index 08df585..5a6708b 100644 --- a/glib/reference/poppler-sections.txt +++ b/glib/reference/poppler-sections.txt @@ -158,6 +158,7 @@ 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_get_encoding poppler_fonts_iter_is_embedded poppler_fonts_iter_is_subset poppler_fonts_iter_next -- 1.7.5.4