beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / FontInfo.h
blob615b6793de34b50c1e9defab517299e906539a10
1 //========================================================================
2 //
3 // FontInfo.h
4 //
5 // Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
6 // Copyright (C) 2005-2008, 2010, 2011 Albert Astals Cid <aacid@kde.org>
7 // Copyright (C) 2005 Brad Hards <bradh@frogmouth.net>
8 // Copyright (C) 2009 Pino Toscano <pino@kde.org>
9 // Copyright (C) 2012 Adrian Johnson <ajohnson@redneon.com>
10 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
12 // To see a description of the changes please see the Changelog file that
13 // came with your tarball or type make ChangeLog if you are building from git
15 //========================================================================
17 //========================================================================
19 // Based on code from pdffonts.cc
21 // Copyright 2001-2007 Glyph & Cog, LLC
23 //========================================================================
25 #ifndef FONT_INFO_H
26 #define FONT_INFO_H
28 #include "Object.h"
29 #include "goo/gtypes.h"
30 #include "goo/GooList.h"
32 class GfxFont;
33 class PDFDoc;
35 class FontInfo {
36 public:
37 enum Type {
38 unknown,
39 Type1,
40 Type1C,
41 Type1COT,
42 Type3,
43 TrueType,
44 TrueTypeOT,
45 CIDType0,
46 CIDType0C,
47 CIDType0COT,
48 CIDTrueType,
49 CIDTrueTypeOT
52 // Constructor.
53 FontInfo(GfxFont *fontA, XRef *xrefA);
54 // Copy constructor
55 FontInfo(FontInfo& f);
56 // Destructor.
57 ~FontInfo();
59 GooString *getName() { return name; };
60 GooString *getSubstituteName() { return substituteName; };
61 GooString *getFile() { return file; };
62 GooString *getEncoding() { return encoding; };
63 Type getType() { return type; };
64 GBool getEmbedded() { return emb; };
65 GBool getSubset() { return subset; };
66 GBool getToUnicode() { return hasToUnicode; };
67 Ref getRef() { return fontRef; };
68 Ref getEmbRef() { return embRef; };
70 private:
71 GooString *name;
72 GooString *substituteName;
73 GooString *file;
74 GooString *encoding;
75 Type type;
76 GBool emb;
77 GBool subset;
78 GBool hasToUnicode;
79 Ref fontRef;
80 Ref embRef;
83 class FontInfoScanner {
84 public:
86 // Constructor.
87 FontInfoScanner(PDFDoc *doc, int firstPage = 0);
88 // Destructor.
89 ~FontInfoScanner();
91 GooList *scan(int nPages);
93 private:
95 PDFDoc *doc;
96 int currentPage;
97 std::set<int> fonts;
98 std::set<int> visitedObjects;
100 void scanFonts(XRef *xrefA, Dict *resDict, GooList *fontsList);
103 #endif