Okular

fontinfo.h
1/*
2 SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#ifndef _OKULAR_FONTINFO_H_
8#define _OKULAR_FONTINFO_H_
9
10#include <QList>
11#include <QMetaType>
12#include <QSharedDataPointer>
13#include <QString>
14
15#include "okularcore_export.h"
16
17namespace Okular
18{
19class FontInfoPrivate;
20
21/**
22 * @short A small class that represents the information of a font.
23 */
24class OKULARCORE_EXPORT FontInfo
25{
26public:
27 typedef QVector<FontInfo> List;
28
29 /**
30 * The possible kinds of fonts.
31 */
32 enum FontType {
33 Unknown,
34 Type1,
35 Type1C,
36 Type1COT,
37 Type3,
38 TrueType,
39 TrueTypeOT,
40 CIDType0,
41 CIDType0C,
42 CIDType0COT,
43 CIDTrueType,
44 CIDTrueTypeOT,
45 TeXPK, ///< @since 0.10 (KDE 4.4)
46 TeXVirtual, ///< @since 0.10 (KDE 4.4)
47 TeXFontMetric, ///< @since 0.10 (KDE 4.4)
48 TeXFreeTypeHandled ///< @since 0.10 (KDE 4.4)
49 };
50
51 /**
52 * The possible kinds of embed.
53 */
54 enum EmbedType { NotEmbedded, EmbeddedSubset, FullyEmbedded };
55
56 /**
57 * Construct a new empty font info.
58 */
59 FontInfo();
60 /**
61 * Copy constructor.
62 */
63 FontInfo(const FontInfo &fi);
64 /**
65 * Destructor.
66 */
67 ~FontInfo();
68
69 /**
70 * Returns the name of the font.
71 */
72 QString name() const;
73 /**
74 * Sets a new name for the font.
75 */
76 void setName(const QString &name);
77
78 /**
79 * Returns the substitute name for the font.
80 */
81 QString substituteName() const;
82
83 /**
84 * Sets a new substitute name for the font.
85 */
86 void setSubstituteName(const QString &substituteName);
87
88 /**
89 * Returns the type of the font.
90 */
91 FontType type() const;
92 /**
93 * Change the type of the font.
94 */
95 void setType(FontType type);
96
97 /**
98 * Returns the type of font embedding.
99 */
100 EmbedType embedType() const;
101 /**
102 * Sets the type of font embedding.
103 */
104 void setEmbedType(EmbedType type);
105
106 /**
107 * In case of not embedded font, returns the path of the font that
108 * represents this font.
109 */
110 QString file() const;
111 void setFile(const QString &file);
112
113 /**
114 * In case of embedded fonts, returns if the font can be extracted into a QByteArray
115 *
116 * @since 0.8 (KDE 4.2)
117 */
118 bool canBeExtracted() const;
119
120 /**
121 * Sets if a font can be extracted or not. False by default
122 */
123 void setCanBeExtracted(bool extractable);
124
125 /**
126 * Sets the "native" @p id of the font info.
127 *
128 * This is for use of the Generator, that can optionally store an
129 * handle (a pointer, an identifier, etc) of the "native" font
130 * object, if any.
131 *
132 * @since 0.8 (KDE 4.2)
133 */
134 void setNativeId(const QVariant &id);
135
136 /**
137 * Returns the "native" id of the font info.
138 *
139 * @since 0.8 (KDE 4.2)
140 */
141 QVariant nativeId() const;
142
143 FontInfo &operator=(const FontInfo &fi);
144
145 /**
146 * Comparison operator.
147 */
148 bool operator==(const FontInfo &fi) const;
149
150 bool operator!=(const FontInfo &fi) const;
151
152private:
153 /// @cond PRIVATE
154 friend class FontInfoPrivate;
155 /// @endcond
157};
158
159}
160
161Q_DECLARE_METATYPE(Okular::FontInfo)
162
163#endif
A small class that represents the information of a font.
Definition fontinfo.h:25
EmbedType
The possible kinds of embed.
Definition fontinfo.h:54
FontType
The possible kinds of fonts.
Definition fontinfo.h:32
global.h
Definition action.h:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.