summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2011-10-20 00:51:31 +0200
committerAlbert Astals Cid <aacid@kde.org>2011-10-20 00:51:31 +0200
commitc0affb1845c339f89ca67608cb9fd9134ff902f5 (patch)
tree3a52d71e199bebe33d249a83cee3a38521ff19af
parentc5c513b5b72e03f6f0a94d04f7d8a22fe9bdaa80 (diff)
xpdf303: GfxFont::getOrignName/getName rework
-rw-r--r--poppler/FontInfo.cc4
-rw-r--r--poppler/GfxFont.cc4
-rw-r--r--poppler/GfxFont.h6
-rw-r--r--poppler/PSOutputDev.cc8
-rw-r--r--poppler/TextOutputDev.cc5
5 files changed, 9 insertions, 18 deletions
diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc
index 7352ed1c..9c6a97ec 100644
--- a/poppler/FontInfo.cc
+++ b/poppler/FontInfo.cc
@@ -172,9 +172,9 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
fontRef = *font->getID();
// font name
- origName = font->getOrigName();
+ origName = font->getName();
if (origName != NULL) {
- name = font->getOrigName()->copy();
+ name = font->getName()->copy();
} else {
name = NULL;
}
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index abb86143..ae9e9c9c 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -168,7 +168,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) {
tag = new GooString(tagA);
id = idA;
name = nameA;
- origName = nameA;
embFontName = NULL;
extFontFile = NULL;
family = NULL;
@@ -182,9 +181,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) {
GfxFont::~GfxFont() {
delete tag;
delete family;
- if (origName && origName != name) {
- delete origName;
- }
if (name) {
delete name;
}
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index 81723526..2207b9fc 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -187,9 +187,6 @@ public:
// Does this font match the tag?
GBool matches(char *tagA) { return !tag->cmp(tagA); }
- // Get base font name.
- GooString *getName() { return name; }
-
// Get font family name.
GooString *getFamily() { return family; }
@@ -201,7 +198,7 @@ public:
// Get the original font name (ignornig any munging that might have
// been done to map to a canonical Base-14 font name).
- GooString *getOrigName() { return origName; }
+ GooString *getName() { return name; }
// Get font type.
GfxFontType getType() { return type; }
@@ -281,7 +278,6 @@ protected:
GooString *family; // font family
Stretch stretch; // font stretch
Weight weight; // font weight
- GooString *origName; // original font name
GfxFontType type; // type of font
int flags; // font descriptor flags
GooString *embFontName; // name of embedded font
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 2a2388a8..37e4bb61 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -1708,20 +1708,20 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
} else if (globalParams->getPSEmbedType1() &&
font->getType() == fontType1C &&
font->getEmbeddedFontID(&fontFileID) &&
- font->getOrigName()) {
+ font->getName()) {
// use the PDF font name because the embedded font name might
// not include the subset prefix
- psName = font->getOrigName()->sanitizedName(gTrue /* ps mode */);
+ psName = font->getName()->sanitizedName(gTrue /* ps mode */);
setupEmbeddedType1CFont(font, &fontFileID, psName);
// check for embedded OpenType - Type 1C font
} else if (globalParams->getPSEmbedType1() &&
font->getType() == fontType1COT &&
font->getEmbeddedFontID(&fontFileID) &&
- font->getOrigName()) {
+ font->getName()) {
// use the PDF font name because the embedded font name might
// not include the subset prefix
- psName = font->getOrigName()->sanitizedName(gTrue /* ps mode */);
+ psName = font->getName()->sanitizedName(gTrue /* ps mode */);
setupEmbeddedOpenTypeT1CFont(font, &fontFileID, psName);
// check for external Type 1 font file
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 5de089f0..570d53d7 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -205,9 +205,8 @@ TextFontInfo::TextFontInfo(GfxState *state) {
if (gfxFont)
gfxFont->incRefCnt();
#if TEXTOUT_WORD_LIST
- fontName = (gfxFont && gfxFont->getOrigName())
- ? gfxFont->getOrigName()->copy()
- : (GooString *)NULL;
+ fontName = (gfxFont && gfxFont->getName()) ? gfxFont->getName()->copy()
+ : (GooString *)NULL;
flags = gfxFont ? gfxFont->getFlags() : 0;
#endif
}