[poppler] poppler/poppler: FontInfo.cc,1.1,1.2
Kristian Hogsberg
krh at freedesktop.org
Mon Jun 20 10:38:35 PDT 2005
Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv31521/poppler
Modified Files:
FontInfo.cc
Log Message:
2005-06-20 Kristian Høgsberg <krh at 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.
Index: FontInfo.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/FontInfo.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- FontInfo.cc 13 Jun 2005 17:18:32 -0000 1.1
+++ FontInfo.cc 20 Jun 2005 17:38:29 -0000 1.2
@@ -101,13 +101,14 @@
}
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 @@
}
FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
+ GooString *origName;
Ref embRef;
Object fontObj, toUnicodeObj;
int i;
@@ -154,7 +156,12 @@
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) {
More information about the poppler
mailing list