Commit c0affb18 authored by Albert Astals Cid's avatar Albert Astals Cid

xpdf303: GfxFont::getOrignName/getName rework

parent c5c513b5
...@@ -172,9 +172,9 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) { ...@@ -172,9 +172,9 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
fontRef = *font->getID(); fontRef = *font->getID();
// font name // font name
origName = font->getOrigName(); origName = font->getName();
if (origName != NULL) { if (origName != NULL) {
name = font->getOrigName()->copy(); name = font->getName()->copy();
} else { } else {
name = NULL; name = NULL;
} }
......
...@@ -168,7 +168,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) { ...@@ -168,7 +168,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) {
tag = new GooString(tagA); tag = new GooString(tagA);
id = idA; id = idA;
name = nameA; name = nameA;
origName = nameA;
embFontName = NULL; embFontName = NULL;
extFontFile = NULL; extFontFile = NULL;
family = NULL; family = NULL;
...@@ -182,9 +181,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) { ...@@ -182,9 +181,6 @@ GfxFont::GfxFont(const char *tagA, Ref idA, GooString *nameA) {
GfxFont::~GfxFont() { GfxFont::~GfxFont() {
delete tag; delete tag;
delete family; delete family;
if (origName && origName != name) {
delete origName;
}
if (name) { if (name) {
delete name; delete name;
} }
......
...@@ -187,9 +187,6 @@ public: ...@@ -187,9 +187,6 @@ public:
// Does this font match the tag? // Does this font match the tag?
GBool matches(char *tagA) { return !tag->cmp(tagA); } GBool matches(char *tagA) { return !tag->cmp(tagA); }
// Get base font name.
GooString *getName() { return name; }
// Get font family name. // Get font family name.
GooString *getFamily() { return family; } GooString *getFamily() { return family; }
...@@ -201,7 +198,7 @@ public: ...@@ -201,7 +198,7 @@ public:
// Get the original font name (ignornig any munging that might have // Get the original font name (ignornig any munging that might have
// been done to map to a canonical Base-14 font name). // been done to map to a canonical Base-14 font name).
GooString *getOrigName() { return origName; } GooString *getName() { return name; }
// Get font type. // Get font type.
GfxFontType getType() { return type; } GfxFontType getType() { return type; }
...@@ -281,7 +278,6 @@ protected: ...@@ -281,7 +278,6 @@ protected:
GooString *family; // font family GooString *family; // font family
Stretch stretch; // font stretch Stretch stretch; // font stretch
Weight weight; // font weight Weight weight; // font weight
GooString *origName; // original font name
GfxFontType type; // type of font GfxFontType type; // type of font
int flags; // font descriptor flags int flags; // font descriptor flags
GooString *embFontName; // name of embedded font GooString *embFontName; // name of embedded font
......
...@@ -1708,20 +1708,20 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) { ...@@ -1708,20 +1708,20 @@ void PSOutputDev::setupFont(GfxFont *font, Dict *parentResDict) {
} else if (globalParams->getPSEmbedType1() && } else if (globalParams->getPSEmbedType1() &&
font->getType() == fontType1C && font->getType() == fontType1C &&
font->getEmbeddedFontID(&fontFileID) && font->getEmbeddedFontID(&fontFileID) &&
font->getOrigName()) { font->getName()) {
// use the PDF font name because the embedded font name might // use the PDF font name because the embedded font name might
// not include the subset prefix // not include the subset prefix
psName = font->getOrigName()->sanitizedName(gTrue /* ps mode */); psName = font->getName()->sanitizedName(gTrue /* ps mode */);
setupEmbeddedType1CFont(font, &fontFileID, psName); setupEmbeddedType1CFont(font, &fontFileID, psName);
// check for embedded OpenType - Type 1C font // check for embedded OpenType - Type 1C font
} else if (globalParams->getPSEmbedType1() && } else if (globalParams->getPSEmbedType1() &&
font->getType() == fontType1COT && font->getType() == fontType1COT &&
font->getEmbeddedFontID(&fontFileID) && font->getEmbeddedFontID(&fontFileID) &&
font->getOrigName()) { font->getName()) {
// use the PDF font name because the embedded font name might // use the PDF font name because the embedded font name might
// not include the subset prefix // not include the subset prefix
psName = font->getOrigName()->sanitizedName(gTrue /* ps mode */); psName = font->getName()->sanitizedName(gTrue /* ps mode */);
setupEmbeddedOpenTypeT1CFont(font, &fontFileID, psName); setupEmbeddedOpenTypeT1CFont(font, &fontFileID, psName);
// check for external Type 1 font file // check for external Type 1 font file
......
...@@ -205,9 +205,8 @@ TextFontInfo::TextFontInfo(GfxState *state) { ...@@ -205,9 +205,8 @@ TextFontInfo::TextFontInfo(GfxState *state) {
if (gfxFont) if (gfxFont)
gfxFont->incRefCnt(); gfxFont->incRefCnt();
#if TEXTOUT_WORD_LIST #if TEXTOUT_WORD_LIST
fontName = (gfxFont && gfxFont->getOrigName()) fontName = (gfxFont && gfxFont->getName()) ? gfxFont->getName()->copy()
? gfxFont->getOrigName()->copy() : (GooString *)NULL;
: (GooString *)NULL;
flags = gfxFont ? gfxFont->getFlags() : 0; flags = gfxFont ? gfxFont->getFlags() : 0;
#endif #endif
} }
......
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