Commit 5d194b92 authored by Brad Hards's avatar Brad Hards

Change FontInfo::type() to return an enumerated value,

rather than a GooString.
parent 1303020b
......@@ -13,17 +13,6 @@
#include "config.h"
#include "FontInfo.h"
static char *fontTypeNames[] = {
"unknown",
"Type 1",
"Type 1C",
"Type 3",
"TrueType",
"CID Type 0",
"CID Type 0C",
"CID TrueType"
};
FontInfoScanner::FontInfoScanner(PDFDoc *docA) {
doc = docA;
currentPage = 1;
......@@ -164,7 +153,7 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
}
// font type
type = new GooString(fontTypeNames[font->getType()]);
type = (FontInfo::Type)font->getType();
// check for an embedded font
if (font->getType() == fontType3) {
......@@ -196,7 +185,7 @@ FontInfo::FontInfo(GfxFont *font, PDFDoc *doc) {
FontInfo::FontInfo(FontInfo& f) {
name = f.name->copy();
type = f.type->copy();
type = f.type;
emb = f.emb;
subset = f.subset;
hasToUnicode = f.hasToUnicode;
......@@ -205,5 +194,4 @@ FontInfo::FontInfo(FontInfo& f) {
FontInfo::~FontInfo() {
delete name;
delete type;
}
......@@ -6,7 +6,17 @@
class FontInfo {
public:
enum Type {
unknown,
Type1,
Type1C,
Type3,
TrueType,
CIDType0,
CIDType0C,
CIDTrueType
};
// Constructor.
FontInfo(GfxFont *fontA, PDFDoc *doc);
// Copy constructor
......@@ -15,14 +25,14 @@ public:
~FontInfo();
GooString *getName() { return name; };
GooString *getType() { return type; };
Type getType() { return type; };
GBool getEmbedded() { return emb; };
GBool getSubset() { return subset; };
GBool getToUnicode() { return hasToUnicode; };
private:
GooString *name;
GooString *type;
Type type;
GBool emb;
GBool subset;
GBool hasToUnicode;
......
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