[poppler] poppler/glib: poppler-document.cc, 1.23,
1.24 poppler-document.h, 1.13, 1.14
Martin Kretzschmar
m_kretzschmar at freedesktop.org
Fri Jul 22 20:35:58 EST 2005
Update of /cvs/poppler/poppler/glib
In directory gabe:/tmp/cvs-serv18795/glib
Modified Files:
poppler-document.cc poppler-document.h
Log Message:
* glib/poppler-document.cc (poppler_fonts_iter_get_name): if the
font is a subset, strip the ABCDEF+ tag.
(poppler_fonts_iter_get_full_name): does what the old get_name did.
(poppler_fonts_iter_get_font_type, poppler_fonts_iter_is_embedded)
(poppler_fonts_iter_is_subset): new wrappers.
* glib/poppler-document.h (PopplerFontType): new enum.
Update prototypes.
Index: poppler-document.cc
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-document.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- poppler-document.cc 7 Jul 2005 11:13:24 -0000 1.23
+++ poppler-document.cc 22 Jul 2005 10:35:56 -0000 1.24
@@ -791,7 +791,7 @@
}
const char *
-poppler_fonts_iter_get_name (PopplerFontsIter *iter)
+poppler_fonts_iter_get_full_name (PopplerFontsIter *iter)
{
GooString *name;
FontInfo *info;
@@ -806,6 +806,58 @@
}
}
+const char *
+poppler_fonts_iter_get_name (PopplerFontsIter *iter)
+{
+ FontInfo *info;
+ const char *name;
+
+ name = poppler_fonts_iter_get_full_name (iter);
+ info = (FontInfo *)iter->items->get (iter->index);
+
+ if (info->getSubset() && name) {
+ while (*name && *name != '+')
+ name++;
+
+ if (*name)
+ name++;
+ }
+
+ return name;
+}
+
+PopplerFontType
+poppler_fonts_iter_get_font_type (PopplerFontsIter *iter)
+{
+ FontInfo *info;
+
+ g_return_val_if_fail (iter != NULL, POPPLER_FONT_TYPE_UNKNOWN);
+
+ info = (FontInfo *)iter->items->get (iter->index);
+
+ return (PopplerFontType)info->getType ();
+}
+
+gboolean
+poppler_fonts_iter_is_embedded (PopplerFontsIter *iter)
+{
+ FontInfo *info;
+
+ info = (FontInfo *)iter->items->get (iter->index);
+
+ return info->getEmbedded();
+}
+
+gboolean
+poppler_fonts_iter_is_subset (PopplerFontsIter *iter)
+{
+ FontInfo *info;
+
+ info = (FontInfo *)iter->items->get (iter->index);
+
+ return info->getSubset();
+}
+
gboolean
poppler_fonts_iter_next (PopplerFontsIter *iter)
{
Index: poppler-document.h
===================================================================
RCS file: /cvs/poppler/poppler/glib/poppler-document.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- poppler-document.h 15 Jun 2005 15:02:46 -0000 1.13
+++ poppler-document.h 22 Jul 2005 10:35:56 -0000 1.14
@@ -52,6 +52,18 @@
POPPLER_PAGE_MODE_USE_ATTACHMENTS,
} PopplerPageMode;
+typedef enum
+{
+ POPPLER_FONT_TYPE_UNKNOWN,
+ POPPLER_FONT_TYPE_TYPE1,
+ POPPLER_FONT_TYPE_TYPE1C,
+ POPPLER_FONT_TYPE_TYPE3,
+ POPPLER_FONT_TYPE_TRUETYPE,
+ POPPLER_FONT_TYPE_CID_TYPE0,
+ POPPLER_FONT_TYPE_CID_TYPE0C,
+ POPPLER_FONT_TYPE_CID_TYPE2
+} PopplerFontType;
+
typedef enum /*< flags >*/
{
POPPLER_VIEWER_PREFERENCES_UNSET = 0,
@@ -105,17 +117,21 @@
gboolean poppler_index_iter_next (PopplerIndexIter *iter);
/* Interface for getting the Fonts of a poppler_document */
-PopplerFontInfo *poppler_font_info_new (PopplerDocument *document);
-gboolean poppler_font_info_scan (PopplerFontInfo *font_info,
- int n_pages,
- PopplerFontsIter **iter);
-void poppler_font_info_free (PopplerFontInfo *font_info);
+PopplerFontInfo *poppler_font_info_new (PopplerDocument *document);
+gboolean poppler_font_info_scan (PopplerFontInfo *font_info,
+ int n_pages,
+ PopplerFontsIter **iter);
+void poppler_font_info_free (PopplerFontInfo *font_info);
-GType poppler_fonts_iter_get_type (void) G_GNUC_CONST;
-PopplerFontsIter *poppler_fonts_iter_copy (PopplerFontsIter *iter);
-void poppler_fonts_iter_free (PopplerFontsIter *iter);
-const char *poppler_fonts_iter_get_name (PopplerFontsIter *iter);
-gboolean poppler_fonts_iter_next (PopplerFontsIter *iter);
+GType poppler_fonts_iter_get_type (void) G_GNUC_CONST;
+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);
+PopplerFontType poppler_fonts_iter_get_font_type (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);
/* Export to ps */
PopplerPSFile *poppler_ps_file_new (PopplerDocument *document,
More information about the poppler
mailing list