1 /*
2  * Copyright (C) 2009, Pino Toscano <pino@kde.org>
3  * Copyright (C) 2020, Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
4  * Copyright (C) 2021, Albert Astals Cid <aacid@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef POPPLER_FONT_H
22 #define POPPLER_FONT_H
23 
24 #include "poppler-global.h"
25 
26 #include <vector>
27 
28 namespace poppler {
29 
30 class document;
31 class document_private;
32 class font_info_private;
33 class font_iterator;
34 class font_iterator_private;
35 
36 class POPPLER_CPP_EXPORT font_info
37 {
38 public:
39     enum type_enum
40     {
41         unknown,
42         type1,
43         type1c,
44         type1c_ot,
45         type3,
46         truetype,
47         truetype_ot,
48         cid_type0,
49         cid_type0c,
50         cid_type0c_ot,
51         cid_truetype,
52         cid_truetype_ot
53     };
54 
55     font_info();
56     font_info(const font_info &fi);
57     ~font_info();
58 
59     std::string name() const;
60     std::string file() const;
61     bool is_embedded() const;
62     bool is_subset() const;
63     type_enum type() const;
64 
65     font_info &operator=(const font_info &fi);
66 
67 private:
68     explicit font_info(font_info_private &dd);
69 
70     font_info_private *d;
71     friend class font_iterator;
72     friend class page;
73 };
74 
75 class POPPLER_CPP_EXPORT font_iterator : public poppler::noncopyable
76 {
77 public:
78     ~font_iterator();
79 
80     std::vector<font_info> next();
81     bool has_next() const;
82     int current_page() const;
83 
84 private:
85     font_iterator(int, document_private *dd);
86 
87     font_iterator_private *d;
88     friend class document;
89     friend class page;
90     friend class page_private;
91 };
92 
93 }
94 
95 #endif
96