Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfontsubset_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFONTSUBSET_P_H
5#define QFONTSUBSET_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include "private/qfontengine_p.h"
20
21QT_BEGIN_NAMESPACE
22
23class QFontSubset
24{
25public:
26 explicit QFontSubset(QFontEngine *fe, uint obj_id = 0)
27 : object_id(obj_id), noEmbed(false), fontEngine(fe), downloaded_glyphs(0), standard_font(false)
28 {
29 fontEngine->ref.ref();
30#ifndef QT_NO_PDF
31 addGlyph(0);
32#endif
33 }
34 ~QFontSubset() {
35 if (!fontEngine->ref.deref())
36 delete fontEngine;
37 }
38
39 QByteArray toTruetype() const;
40#ifndef QT_NO_PDF
41 QByteArray widthArray() const;
42 QByteArray createToUnicodeMap() const;
43 QList<int> getReverseMap() const;
44
45 static QByteArray glyphName(unsigned short unicode, bool symbol);
46
47 qsizetype addGlyph(uint index);
48#endif
49 const uint object_id;
50 bool noEmbed;
51 QFontEngine *fontEngine;
52 QList<uint> glyph_indices;
53 mutable int downloaded_glyphs;
54 mutable bool standard_font;
55 qsizetype nGlyphs() const { return glyph_indices.size(); }
56 mutable QFixed emSquare;
57 mutable QList<QFixed> widths;
58};
59
60QT_END_NAMESPACE
61
62#endif // QFONTSUBSET_P_H
\inmodule QtGui
void setOffset(int o)
QTtfStream(QByteArray &ba)
int offset() const
static QTtfTable generateHhea(const qttf_hhea_table &hhea)
static bool operator<(const QTtfTable &t1, const QTtfTable &t2)
static void convertPath(const QPainterPath &path, QList< TTF_POINT > *points, QList< int > *endPoints, qreal ppem)
static bool operator<(const QTtfGlyph &g1, const QTtfGlyph &g2)
Q_DECLARE_TYPEINFO(QTtfTable, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(qttf_name_table, Q_RELOCATABLE_TYPE)
static QByteArray bindFont(const QList< QTtfTable > &_tables)
static QTtfTable generateHead(const qttf_head_table &head)
static QList< QTtfTable > generateGlyphTables(qttf_font_tables &tables, const QList< QTtfGlyph > &_glyphs)
static QTtfTable generateName(const QList< QTtfNameRecord > &name)
static const unsigned short symbol_map[0x100]
static quint32 checksum(const QByteArray &table)
Flags
[1]
Q_DECLARE_TYPEINFO(QTtfGlyph, Q_RELOCATABLE_TYPE)
static QTtfTable generateMaxp(const qttf_maxp_table &maxp)
Q_DECLARE_TYPEINFO(TTF_POINT, Q_PRIMITIVE_TYPE)
quint32 Tag
static void getGlyphData(QTtfGlyph *glyph, const QList< TTF_POINT > &points, const QList< int > &endPoints, int point_array_size)
Q_DECLARE_TYPEINFO(qttf_head_table, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(qttf_maxp_table, Q_PRIMITIVE_TYPE)
static QTtfTable generateName(const qttf_name_table &name)
qint16 F2DOT14
Q_DECLARE_TYPEINFO(QTtfNameRecord, Q_RELOCATABLE_TYPE)
@ XSame
@ Repeat
@ YShortPositive
@ XShortPositive
@ YSame
@ OffCurve
@ YShortVector
@ OnCurve
@ XShortVector
quint16 GlyphID
static void checkRanges(QPdf::ByteStream &ts, QByteArray &ranges, int &nranges)
quint16 Offset
static void getBounds(const QList< TTF_POINT > &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
Q_DECLARE_TYPEINFO(qttf_hhea_table, Q_PRIMITIVE_TYPE)
static int convertToRelative(QList< TTF_POINT > *points)
#define TO_TTF(x)
static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advance, qreal lsb, qreal ppem)
QByteArray data
quint16 numPoints
quint16 advanceWidth
quint16 index
quint16 numContours
QByteArray data
qttf_head_table head
qttf_maxp_table maxp
qttf_hhea_table hhea
quint16 maxAdvanceWidth
qint16 minLeftSideBearing
qint16 minRightSideBearing
quint16 numberOfHMetrics
quint16 maxCompositeContours
quint16 maxCompositePoints
quint16 maxComponentElements
quint16 maxComponentDepth
QString postscript_name