Commit c264d8a9 authored by Kristian Høgsberg's avatar Kristian Høgsberg

2005-06-20 Kristian Høgsberg <krh@redhat.com>

        * glib/poppler-document.cc:
        * poppler/FontInfo.cc: Fixes from Marco to handle fonts without
        name (typically type 3 fonts) and fix an iterator bug.
parent 4746e63a
2005-06-20 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-document.cc:
* poppler/FontInfo.cc: Fixes from Marco to handle fonts without
name (typically type 3 fonts) and fix an iterator bug.
2005-06-20 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-page.cc (poppler_page_get_link_mapping): Adjust
......
......@@ -777,11 +777,17 @@ poppler_fonts_iter_get_type (void)
const char *
poppler_fonts_iter_get_name (PopplerFontsIter *iter)
{
GooString *name;
FontInfo *info;
info = (FontInfo *)iter->items->get (iter->index);
return info->getName()->getCString();
name = info->getName();
if (name != NULL) {
return info->getName()->getCString();
} else {
return NULL;
}
}
gboolean
......
......@@ -101,13 +101,14 @@ void FontInfoScanner::scanFonts(Dict *resDict, GooList *fontsList) {
}
if (gfxFontDict) {
for (i = 0; i < gfxFontDict->getNumFonts(); ++i) {
int k;
if ((font = gfxFontDict->getFont(i))) {
Ref fontRef = *font->getID();
GBool alreadySeen = gFalse;
// check for an already-seen font
for (i = 0; i < fontsLen; ++i) {
if (fontRef.num == fonts[i].num && fontRef.gen == fonts[i].gen) {
for (k = 0; k < fontsLen; ++k) {
if (fontRef.num == fonts[k].num && fontRef.gen == fonts[k].gen) {
alreadySeen = gTrue;
}
}
......@@ -147,6 +148,7 @@ void FontInfoScanner::scanFonts(Dict *resDict, GooList *fontsList) {
}
FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
GooString *origName;
Ref embRef;
Object fontObj, toUnicodeObj;
int i;
......@@ -154,7 +156,12 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
fontRef = *font->getID();
// font name
name = font->getOrigName()->copy();
origName = font->getOrigName();
if (origName != NULL) {
name = font->getOrigName()->copy();
} else {
name = NULL;
}
// check for an embedded font
if (font->getType() == fontType3) {
......
Markdown is supported
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