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) {
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;
}
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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
......
......@@ -205,8 +205,7 @@ TextFontInfo::TextFontInfo(GfxState *state) {
if (gfxFont)
gfxFont->incRefCnt();
#if TEXTOUT_WORD_LIST
fontName = (gfxFont && gfxFont->getOrigName())
? gfxFont->getOrigName()->copy()
fontName = (gfxFont && gfxFont->getName()) ? gfxFont->getName()->copy()
: (GooString *)NULL;
flags = gfxFont ? gfxFont->getFlags() : 0;
#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