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
qfontengine_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QFONTENGINE_P_H
5#define QFONTENGINE_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 <QtGui/qfontvariableaxis.h>
20#include "QtCore/qatomic.h"
21#include <QtCore/qvarlengtharray.h>
22#include <QtCore/qhashfunctions.h>
23#include "private/qtextengine_p.h"
24#include "private/qfont_p.h"
25
26QT_BEGIN_NAMESPACE
27
28class QPainterPath;
29class QFontEngineGlyphCache;
30
31struct QGlyphLayout;
32
33// ### this only used in getPointInOutline(), refactor it and then remove these magic numbers
41
42typedef void (*qt_destroy_func_t) (void *user_data);
43typedef bool (*qt_get_font_table_func_t) (void *user_data, uint tag, uchar *buffer, uint *length);
44
46
47// Upper bound on the nesting depth of a COLRv1 paint graph.
48#if !defined(QT_MAX_COLRV1_NESTING_DEPTH)
49# define QT_MAX_COLRV1_NESTING_DEPTH 100
50#endif
51
52class Q_GUI_EXPORT QFontEngine
53{
54public:
55 enum Type {
56 Box,
57 Multi,
58
59 // MS Windows types
60 Win,
61
62 // Apple Mac OS types
63 Mac,
64
65 // QWS types
66 Freetype,
67 QPF1,
68 QPF2,
69 Proxy,
70
71 DirectWrite,
72
73 TestFontEngine = 0x1000
74 };
75
76 enum GlyphFormat {
77 Format_None,
78 Format_Render = Format_None,
79 Format_Mono,
80 Format_A8,
81 Format_A32,
82 Format_ARGB
83 };
84
85 enum ShaperFlag {
86 DesignMetrics = 0x0002,
87 GlyphIndicesOnly = 0x0004,
88 FullStringFallback = 0x008
89 };
90 Q_DECLARE_FLAGS(ShaperFlags, ShaperFlag)
91
92 /* Used with the Freetype font engine. */
93 struct Glyph {
94 Glyph() = default;
95 ~Glyph() { delete [] data; }
96 short linearAdvance = 0;
97 unsigned short width = 0;
98 unsigned short height = 0;
99 short x = 0;
100 short y = 0;
101 short advance = 0;
102 signed char format = 0;
103 uchar *data = nullptr;
104 private:
105 Q_DISABLE_COPY(Glyph)
106 };
107
108 virtual ~QFontEngine();
109
110 inline Type type() const { return m_type; }
111
112 // all of these are in unscaled metrics if the engine supports uncsaled metrics,
113 // otherwise in design metrics
114 struct Properties {
115 QByteArray postscriptName;
116 QByteArray copyright;
117 QRectF boundingBox;
118 QFixed emSquare;
119 QFixed ascent;
120 QFixed descent;
121 QFixed leading;
122 QFixed italicAngle;
123 QFixed capHeight;
124 QFixed lineWidth;
125 };
126 virtual Properties properties() const;
127 virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
128 QByteArray getSfntTable(uint tag) const;
129 virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
130
131 struct FaceId {
132 FaceId() : index(0), instanceIndex(-1), encoding(0) {}
133 QByteArray filename;
134 QByteArray uuid;
135 int index;
136 int instanceIndex;
137 int encoding;
138 QMap<QFont::Tag, float> variableAxes;
139 };
140 virtual FaceId faceId() const { return FaceId(); }
141 enum SynthesizedFlags {
142 SynthesizedItalic = 0x1,
143 SynthesizedBold = 0x2,
144 SynthesizedStretch = 0x4
145 };
146 virtual int synthesized() const { return 0; }
147 inline bool supportsSubPixelPositions() const
148 {
149 return supportsHorizontalSubPixelPositions() || supportsVerticalSubPixelPositions();
150 }
151 virtual bool supportsHorizontalSubPixelPositions() const { return false; }
152 virtual bool supportsVerticalSubPixelPositions() const { return false; }
153 virtual QFixedPoint subPixelPositionFor(const QFixedPoint &position) const;
154 QFixed subPixelPositionForX(QFixed x) const
155 {
156 return subPixelPositionFor(QFixedPoint(x, 0)).x;
157 }
158
159 bool preferTypoLineMetrics() const;
160 bool isColorFont() const { return glyphFormat == Format_ARGB; }
161 static bool isIgnorableChar(char32_t ucs4)
162 {
163 return ucs4 == QChar::LineSeparator
164 || ucs4 == QChar::LineFeed
165 || ucs4 == QChar::CarriageReturn
166 || ucs4 == QChar::ParagraphSeparator
167 || (!disableEmojiSegmenter() && (ucs4 & 0xFFF0) == 0xFE00)
168 || QChar::category(ucs4) == QChar::Other_Control;
169 }
170
171 static int maxCachedGlyphSize();
172 static constexpr int maxColrv1NestingDepth() { return QT_MAX_COLRV1_NESTING_DEPTH; }
173
174 virtual QFixed emSquareSize() const;
175
176 /* returns 0 as glyph index for non existent glyphs */
177 virtual glyph_t glyphIndex(uint ucs4) const = 0;
178 virtual int stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const = 0;
179 virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const {}
180 virtual void doKerning(QGlyphLayout *, ShaperFlags) const;
181
182 virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
183 QPainterPath *path, QTextItem::RenderFlags flags);
184
185 void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags,
186 QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &positions);
187
188 virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags);
189 void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags);
190 /**
191 * Create a qimage with the alpha values for the glyph.
192 * Returns an image indexed_8 with index values ranging from 0=fully transparent to 255=opaque
193 */
194 // ### Refactor this into a smaller and more flexible API.
195 virtual QImage alphaMapForGlyph(glyph_t);
196 virtual QImage alphaMapForGlyph(glyph_t glyph, const QFixedPoint &subPixelPosition);
197 virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t);
198 virtual QImage alphaMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t);
199 virtual QImage alphaRGBMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t);
200 virtual QImage bitmapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t, const QColor &color = QColor());
201 QImage renderedPathForGlyph(glyph_t glyph, const QColor &color);
202
203 qreal effectivePixelSizeSquared(const QTransform &transform) const;
204 static bool glyphBoundingBoxExceedsLimit(qreal glyphWidth,
205 qreal glyphHeight,
206 qreal effectivePixelSizeSquared);
207 bool glyphTransformExceedsLimit(glyph_t glyph, const QTransform &transform);
208
209 virtual Glyph *glyphData(glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t);
210 virtual bool hasInternalCaching() const { return false; }
211
212 virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, const QFixedPoint &/*subPixelPosition*/, const QTransform &matrix, GlyphFormat /*format*/)
213 {
214 return boundingBox(glyph, matrix);
215 }
216
217 virtual void removeGlyphFromCache(glyph_t);
218
219 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
220 virtual glyph_metrics_t boundingBox(glyph_t glyph) = 0;
221 virtual glyph_metrics_t boundingBox(glyph_t glyph, const QTransform &matrix);
222 glyph_metrics_t tightBoundingBox(const QGlyphLayout &glyphs, QTextItem::RenderFlags flags);
223
224 virtual QFixed ascent() const;
225 virtual QFixed capHeight() const = 0;
226 virtual QFixed descent() const;
227 virtual QFixed leading() const;
228 virtual QFixed xHeight() const;
229 virtual QFixed averageCharWidth() const;
230
231 virtual QFixed lineThickness() const;
232 virtual QFixed underlinePosition() const;
233
234 virtual qreal maxCharWidth() const = 0;
235 virtual qreal minLeftBearing() const;
236 virtual qreal minRightBearing() const;
237
238 virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr);
239
240 inline bool canRender(uint ucs4) const { return glyphIndex(ucs4) != 0; }
241 virtual bool canRender(const QChar *str, int len) const;
242
243 virtual bool supportsTransformation(const QTransform &transform) const;
244
245 virtual int glyphCount() const;
246 virtual int glyphMargin(GlyphFormat format) { return format == Format_A32 ? 2 : 0; }
247 bool hasHinting() const;
248
249 virtual QFontEngine *cloneWithSize(qreal /*pixelSize*/) const { return nullptr; }
250
251 virtual Qt::HANDLE handle() const;
252
253 virtual QList<QFontVariableAxis> variableAxes() const;
254
255 virtual QString glyphName(glyph_t index) const;
256 virtual glyph_t findGlyph(QLatin1StringView name) const;
257
258 void *harfbuzzFont() const;
259 void *harfbuzzFace() const;
260 bool supportsScript(QChar::Script script) const;
261
262 inline static bool scriptRequiresOpenType(QChar::Script script)
263 {
264 return ((script >= QChar::Script_Syriac && script <= QChar::Script_Sinhala)
265 || script == QChar::Script_Khmer || script == QChar::Script_Nko);
266 }
267
268 virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints);
269
270 void clearGlyphCache(const void *key);
271 void setGlyphCache(const void *key, QFontEngineGlyphCache *data);
272 QFontEngineGlyphCache *glyphCache(const void *key, GlyphFormat format, const QTransform &transform, const QColor &color = QColor()) const;
273
274 static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
275 static quint32 getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint unicode);
276
277 static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily);
278
279 virtual bool hasUnreliableGlyphOutline() const;
280 virtual bool expectsGammaCorrectedBlending(QFontEngine::GlyphFormat format) const;
281
282 static bool disableEmojiSegmenter();
283
284 static constexpr qsizetype maximumEngineCount() { return 256; }
285
286 enum HintStyle {
287 HintUnset = -1,
288 HintNone,
289 HintLight,
290 HintMedium,
291 HintFull
292 };
293 virtual void setDefaultHintStyle(HintStyle) { }
294
295 enum SubpixelAntialiasingType {
296 Subpixel_Unset = -1,
297 Subpixel_None,
298 Subpixel_RGB,
299 Subpixel_BGR,
300 Subpixel_VRGB,
301 Subpixel_VBGR
302 };
303
304private:
305 const Type m_type;
306
307public:
308 QAtomicInt ref;
309 QFontDef fontDef;
310
311 class Holder { // replace by std::unique_ptr once available
312 void *ptr;
313 qt_destroy_func_t destroy_func;
314 public:
315 Holder() : ptr(nullptr), destroy_func(nullptr) {}
316 explicit Holder(void *p, qt_destroy_func_t d) : ptr(p), destroy_func(d) {}
317 ~Holder() { if (ptr && destroy_func) destroy_func(ptr); }
318 Holder(Holder &&other) noexcept
319 : ptr(std::exchange(other.ptr, nullptr)),
320 destroy_func(std::exchange(other.destroy_func, nullptr))
321 {
322 }
323 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(Holder)
324
325 void swap(Holder &other) noexcept
326 {
327 qSwap(ptr, other.ptr);
328 qSwap(destroy_func, other.destroy_func);
329 }
330
331 void *get() const noexcept { return ptr; }
332 void *release() noexcept {
333 void *result = ptr;
334 ptr = nullptr;
335 destroy_func = nullptr;
336 return result;
337 }
338 void reset() noexcept { Holder().swap(*this); }
339 qt_destroy_func_t get_deleter() const noexcept { return destroy_func; }
340
341 bool operator!() const noexcept { return !ptr; }
342 };
343
344 mutable Holder font_; // \ NOTE: Declared before m_glyphCaches, so font_, face_
345 mutable Holder face_; // / are destroyed _after_ m_glyphCaches is destroyed.
346
347 struct FaceData {
348 void *user_data;
349 qt_get_font_table_func_t get_font_table;
350 } faceData;
351
352 uint cache_cost; // amount of mem used in bytes by the font
353 uint fsType : 16;
354 bool symbol;
355 bool isSmoothlyScalable;
356 struct KernPair {
357 uint left_right;
358 QFixed adjust;
359
360 inline bool operator<(const KernPair &other) const
361 {
362 return left_right < other.left_right;
363 }
364 };
365 QList<KernPair> kerning_pairs;
366 void loadKerningPairs(QFixed scalingFactor);
367
368 GlyphFormat glyphFormat;
369 int m_subPixelPositionCount; // Number of positions within a single pixel for this cache
370
371protected:
372 explicit QFontEngine(Type type);
373
374 QFixed firstLeftBearing(const QGlyphLayout &glyphs);
375 QFixed lastRightBearing(const QGlyphLayout &glyphs);
376
377 QFixed calculatedCapHeight() const;
378
379 mutable QFixed m_ascent;
380 mutable QFixed m_descent;
381 mutable QFixed m_leading;
382 mutable bool m_heightMetricsQueried;
383
384 virtual void initializeHeightMetrics() const;
385 bool processHheaTable() const;
386 bool processOS2Table() const;
387
388private:
389 struct GlyphCacheEntry {
390 GlyphCacheEntry();
391 GlyphCacheEntry(const GlyphCacheEntry &);
392 ~GlyphCacheEntry();
393
394 GlyphCacheEntry &operator=(const GlyphCacheEntry &);
395
396 QExplicitlySharedDataPointer<QFontEngineGlyphCache> cache;
397 bool operator==(const GlyphCacheEntry &other) const { return cache == other.cache; }
398 };
399 typedef std::list<GlyphCacheEntry> GlyphCaches;
400 mutable QHash<const void *, GlyphCaches> m_glyphCaches;
401
402private:
403 mutable qreal m_minLeftBearing;
404 mutable qreal m_minRightBearing;
405 mutable int m_hasHinting = -1;
406};
408
409Q_DECLARE_OPERATORS_FOR_FLAGS(QFontEngine::ShaperFlags)
410
411inline bool operator ==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
412{
413 return f1.index == f2.index
414 && f1.encoding == f2.encoding
415 && f1.filename == f2.filename
416 && f1.uuid == f2.uuid
417 && f1.instanceIndex == f2.instanceIndex
418 && f1.variableAxes == f2.variableAxes;
419}
420
421inline size_t qHash(const QFontEngine::FaceId &f, size_t seed = 0)
422 noexcept(noexcept(qHash(f.filename)))
423{
424 return qHashMulti(seed, f.filename, f.uuid, f.index, f.instanceIndex, f.encoding, f.variableAxes.keys(), f.variableAxes.values());
425}
426
427
428class QGlyph;
429
430
431
433{
434public:
435 QFontEngineBox(int size);
437
438 virtual glyph_t glyphIndex(uint ucs4) const override;
439 virtual int stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
440 virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
441
442 void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
443 virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override;
444
445 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
446 virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
447 virtual QFontEngine *cloneWithSize(qreal pixelSize) const override;
448
449 virtual QFixed emSquareSize() const override { return _size; }
450 virtual QFixed ascent() const override;
451 virtual QFixed capHeight() const override;
452 virtual QFixed descent() const override;
453 virtual QFixed leading() const override;
454 virtual qreal maxCharWidth() const override;
455 virtual qreal minLeftBearing() const override { return 0; }
456 virtual qreal minRightBearing() const override { return 0; }
457 virtual QImage alphaMapForGlyph(glyph_t) override;
458
459 virtual bool canRender(const QChar *string, int len) const override;
460
461 inline int size() const { return _size; }
462
463protected:
464 explicit QFontEngineBox(Type type, int size);
465
466private:
467 friend class QFontPrivate;
468 int _size;
469};
470
471class Q_GUI_EXPORT QFontEngineMulti : public QFontEngine
472{
473public:
474 explicit QFontEngineMulti(QFontEngine *engine, int script, const QStringList &fallbackFamilies = QStringList());
475 ~QFontEngineMulti();
476
477 virtual int glyphCount() const override;
478 virtual glyph_t glyphIndex(uint ucs4) const override;
479 virtual int stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override;
480
481 virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override;
482 virtual glyph_metrics_t boundingBox(glyph_t glyph) override;
483
484 virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override;
485 virtual void doKerning(QGlyphLayout *, ShaperFlags) const override;
486 virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override;
487 virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = nullptr, qreal *rightBearing = nullptr) override;
488
489 virtual QFixed emSquareSize() const override;
490 virtual QFixed ascent() const override;
491 virtual QFixed capHeight() const override;
492 virtual QFixed descent() const override;
493 virtual QFixed leading() const override;
494 virtual QFixed xHeight() const override;
495 virtual QFixed averageCharWidth() const override;
496 virtual QImage alphaMapForGlyph(glyph_t) override;
497 virtual QImage alphaMapForGlyph(glyph_t glyph, const QFixedPoint &subPixelPosition) override;
498 virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t) override;
499 virtual QImage alphaMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override;
500 virtual QImage alphaRGBMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override;
501
502 virtual QFixed lineThickness() const override;
503 virtual QFixed underlinePosition() const override;
504 virtual qreal maxCharWidth() const override;
505 virtual qreal minLeftBearing() const override;
506 virtual qreal minRightBearing() const override;
507
508 virtual QList<QFontVariableAxis> variableAxes() const override;
509
510 virtual bool canRender(const QChar *string, int len) const override;
511 QString glyphName(glyph_t glyph) const override;
512 glyph_t findGlyph(QLatin1StringView name) const override;
513
514 inline int fallbackFamilyCount() const { return m_fallbackFamilies.size(); }
515 inline QString fallbackFamilyAt(int at) const { return m_fallbackFamilies.at(at); }
516
517 void setFallbackFamiliesList(const QStringList &fallbackFamilies);
518
519 static uchar highByte(glyph_t glyph); // Used for determining engine
520
521 inline QFontEngine *engine(int at) const
522 { Q_ASSERT(at < m_engines.size()); return m_engines.at(at); }
523
524 void ensureEngineAt(int at);
525
526 static QFontEngine *createMultiFontEngine(QFontEngine *fe, int script);
527
528protected:
529 virtual void ensureFallbackFamiliesQueried();
530 virtual bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const;
531 virtual QFontEngine *loadEngine(int at);
532
533private:
534 QList<QFontEngine *> m_engines;
535 QStringList m_fallbackFamilies;
536 const int m_script;
537 bool m_fallbackFamiliesQueried;
538};
539
541{
542public:
543 QTestFontEngine(int size);
544};
545
546QT_END_NAMESPACE
547
548
549
550#endif // QFONTENGINE_P_H
\inmodule QtCore
Definition qbytearray.h:58
virtual QFixed emSquareSize() const override
virtual glyph_metrics_t boundingBox(glyph_t glyph) override
virtual QImage alphaMapForGlyph(glyph_t) override
virtual qreal maxCharWidth() const override
virtual QFontEngine * cloneWithSize(qreal pixelSize) const override
int size() const
virtual qreal minLeftBearing() const override
virtual int stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override
virtual QFixed leading() const override
virtual bool canRender(const QChar *string, int len) const override
virtual QFixed descent() const override
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override
QFontEngineBox(Type type, int size)
virtual QFixed ascent() const override
virtual QFixed capHeight() const override
virtual qreal minRightBearing() const override
QFontEngineBox(int size)
\inmodule QtCore
Definition qmutex.h:347
friend class QFontEngine
Definition qpainter.h:433
\inmodule QtCore
Definition qmutex.h:343
QTestFontEngine(int size)
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
#define qApp
Q_DECLARE_TYPEINFO(QDateTime::Data, Q_RELOCATABLE_TYPE)
Q_TRACE_POINT(qtcore, QFactoryLoader_update, const QString &fileName)
QRecursiveMutex * qt_fontdatabase_mutex()
static bool familySupportsWritingSystem(QtFontFamily *family, size_t writingSystem)
void qt_registerFont(const QString &familyName, const QString &stylename, const QString &foundryname, int weight, QFont::Style style, int stretch, bool antialiased, bool scalable, int pixelSize, bool fixedPitch, bool colorFont, const QSupportedWritingSystems &writingSystems, void *handle)
static bool equalsCaseInsensitive(const QString &a, const QString &b)
static void parseFontName(const QString &name, QString &foundry, QString &family)
static const int scriptForWritingSystem[]
bool qt_isFontFamilyPopulated(const QString &familyName)
#define SMOOTH_SCALABLE
static QString styleStringHelper(int weight, QFont::Style style)
static int getFontWeight(const QString &weightString)
static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
Q_GUI_EXPORT int qt_script_for_writing_system(QFontDatabase::WritingSystem writingSystem)
Q_TRACE_POINT(qtgui, QFontDatabase_loadEngine, const QString &families, int pointSize)
static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QFontDatabasePrivate::ExtendedScript script)
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QFontDatabasePrivate::ExtendedScript script)
void qt_registerFontFamily(const QString &familyName)
void qt_registerAliasToFontFamily(const QString &familyName, const QString &alias)
QString qt_resolveFontFamilyAlias(const QString &alias)
static QStringList familyList(const QFontDef &req)
void qt_cleanupFontDatabase()
static QtFontStyle * bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey, const QString &styleName=QString())
bool operator==(const QtFontFallbacksCacheKey &lhs, const QtFontFallbacksCacheKey &rhs) noexcept
size_t qHash(const QtFontFallbacksCacheKey &key, size_t seed=0) noexcept
bool operator!=(const QtFontFallbacksCacheKey &lhs, const QtFontFallbacksCacheKey &rhs) noexcept
void(*) qt_destroy_func_t(void *user_data)
bool(*) qt_get_font_table_func_t(void *user_data, uint tag, uchar *buffer, uint *length)
#define QT_MAX_COLRV1_NESTING_DEPTH
HB_Compat_Error
@ Err_Invalid_SubTable_Format
@ Err_Invalid_SubTable
@ Err_Invalid_Argument
@ Err_Ok
@ Err_Not_Covered
#define qGuiApp
#define Q_LOGGING_CATEGORY(name,...)
#define qCInfo(category,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192
QtFontFamily * family
QtFontSize * size
QtFontStyle * style
QtFontFoundry * foundry
QFont::StyleHint styleHint
QtFontStyle * style(const QtFontStyle::Key &, const QString &=QString(), StyleRetrievalFlags flags=NoRetrievalFlags)
QtFontStyle ** styles