Commit 2d526508 authored by Martin Kretzschmar's avatar Martin Kretzschmar
Browse files

* 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.
parent 43bed4aa
2005-07-20 Martin Kretzschmar <martink@gnome.org>
* 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.
2005-07-15 Albert Astals Cid <aacid@kde.org>
* splash/Splash.cc: Fix bugs #3728 and #3750
......
......@@ -791,7 +791,7 @@ poppler_fonts_iter_get_type (void)
}
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 @@ poppler_fonts_iter_get_name (PopplerFontsIter *iter)
}
}
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)
{
......
......@@ -52,6 +52,18 @@ typedef enum
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 @@ PopplerAction *poppler_index_iter_get_action (PopplerIndexIter *iter);
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);
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);
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);
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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment