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
qtextengine_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 QTEXTENGINE_P_H
5#define QTEXTENGINE_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 for the convenience
12// of other Qt classes. 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/qpaintengine.h"
20#include "QtGui/qtextcursor.h"
21#include "QtGui/qtextobject.h"
22#include "QtGui/qtextoption.h"
23#include "QtGui/qtextlayout.h"
24
25#include "QtCore/qlist.h"
26#include "QtCore/qnamespace.h"
27#include "QtCore/qset.h"
28#include <QtCore/qspan.h>
29#include "QtCore/qstring.h"
30#include "QtCore/qvarlengtharray.h"
31
32#include "private/qfixed_p.h"
33#include "private/qfont_p.h"
34#include "private/qtextformat_p.h"
35#include "private/qunicodetools_p.h"
36#ifndef QT_BUILD_COMPAT_LIB
37#include "private/qtextdocument_p.h"
38#endif
39
40#include <stdlib.h>
41#include <vector>
42
43QT_BEGIN_NAMESPACE
44
45class QFontPrivate;
46class QFontEngine;
47
48class QString;
49class QPainter;
50
51class QAbstractTextDocumentLayout;
52
53typedef quint32 glyph_t;
54
55// this uses the same coordinate system as Qt, but a different one to freetype.
56// * y is usually negative, and is equal to the ascent.
57// * negative yoff means the following stuff is drawn higher up.
58// the characters bounding rect is given by QRect(x,y,width,height), its advance by
59// xoo and yoff
60struct Q_GUI_EXPORT glyph_metrics_t
61{
62 inline glyph_metrics_t()
63 : x(100000), y(100000) {}
64 inline glyph_metrics_t(QFixed _x, QFixed _y, QFixed _width, QFixed _height, QFixed _xoff, QFixed _yoff)
65 : x(_x),
66 y(_y),
67 width(_width),
68 height(_height),
69 xoff(_xoff),
70 yoff(_yoff)
71 {}
72 QFixed x;
73 QFixed y;
74 QFixed width;
75 QFixed height;
76 QFixed xoff;
77 QFixed yoff;
78
79 glyph_metrics_t transformed(const QTransform &xform) const;
80 inline bool isValid() const {return x != 100000 && y != 100000;}
81
82 inline QFixed leftBearing() const
83 {
84 if (!isValid())
85 return QFixed();
86
87 return x;
88 }
89
90 inline QFixed rightBearing() const
91 {
92 if (!isValid())
93 return QFixed();
94
95 return xoff - x - width;
96 }
97};
98Q_DECLARE_TYPEINFO(glyph_metrics_t, Q_PRIMITIVE_TYPE);
99
100struct Q_AUTOTEST_EXPORT QScriptAnalysis
101{
102 enum Flags {
103 None = 0,
104 Lowercase = 1,
105 Uppercase = 2,
106 SmallCaps = 3,
107 LineOrParagraphSeparator = 4,
108 Space = 5,
109 SpaceTabOrObject = Space,
110 Nbsp = 6,
111 Tab = 7,
112 TabOrObject = Tab,
113 Object = 8
114 };
115 enum BidiFlags {
116 BidiBN = 1,
117 BidiMaybeResetToParagraphLevel = 2,
118 BidiResetToParagraphLevel = 4,
119 BidiMirrored = 8
120 };
121 unsigned short script : 8;
122 unsigned short flags : 4;
123 unsigned short bidiFlags : 4;
124 unsigned short bidiLevel : 8; // Unicode Bidi algorithm embedding level (0-125)
125 QChar::Direction bidiDirection : 8; // used when running the bidi algorithm
126 inline bool operator == (const QScriptAnalysis &other) const {
127 return script == other.script && bidiLevel == other.bidiLevel && flags == other.flags;
128 }
129};
130Q_DECLARE_TYPEINFO(QScriptAnalysis, Q_PRIMITIVE_TYPE);
131
133{
135 : type(0), nKashidas(0), space_18d6(0)
136 {}
137
143
144 uint type :2;
145 uint nKashidas : 6; // more do not make sense...
146 uint space_18d6 : 24;
147};
149
156static_assert(sizeof(QGlyphAttributes) == 1);
158
160{
161 static constexpr qsizetype SpaceNeeded = sizeof(glyph_t) + sizeof(QFixed) + sizeof(QFixedPoint)
162 + sizeof(QGlyphAttributes) + sizeof(QGlyphJustification);
163
164 // init to 0 not needed, done when shaping
165 QFixedPoint *offsets; // 8 bytes per element
166 glyph_t *glyphs; // 4 bytes per element
167 QFixed *advances; // 4 bytes per element
168 QGlyphJustification *justifications; // 4 bytes per element
169 QGlyphAttributes *attributes; // 1 byte per element
170
172
173 inline QGlyphLayout() : numGlyphs(0) {}
174
175 inline explicit QGlyphLayout(char *address, int totalGlyphs)
176 {
177 offsets = reinterpret_cast<QFixedPoint *>(address);
178 qsizetype offset = totalGlyphs * sizeof(QFixedPoint);
179 glyphs = reinterpret_cast<glyph_t *>(address + offset);
180 offset += totalGlyphs * sizeof(glyph_t);
181 advances = reinterpret_cast<QFixed *>(address + offset);
182 offset += totalGlyphs * sizeof(QFixed);
183 justifications = reinterpret_cast<QGlyphJustification *>(address + offset);
184 offset += totalGlyphs * sizeof(QGlyphJustification);
185 attributes = reinterpret_cast<QGlyphAttributes *>(address + offset);
186 numGlyphs = totalGlyphs;
187 }
188
189 inline QGlyphLayout mid(int position, int n = -1) const {
190 QGlyphLayout copy = *this;
191 copy.glyphs += position;
192 copy.advances += position;
193 copy.offsets += position;
194 copy.justifications += position;
195 copy.attributes += position;
196 if (n == -1)
197 copy.numGlyphs -= position;
198 else
199 copy.numGlyphs = n;
200 return copy;
201 }
202
203 inline QFixed effectiveAdvance(int item) const
204 { return (advances[item] + QFixed::fromFixed(justifications[item].space_18d6)) * !attributes[item].dontPrint; }
205
206 inline void clear(int first = 0, int last = -1) {
207 if (last == -1)
208 last = numGlyphs;
209 if (first == 0 && last == numGlyphs
210 && reinterpret_cast<char *>(offsets + numGlyphs) == reinterpret_cast<char *>(glyphs)) {
211 memset(static_cast<void *>(offsets), 0, qsizetype(numGlyphs) * SpaceNeeded);
212 } else {
213 const int num = last - first;
214 memset(static_cast<void *>(offsets + first), 0, num * sizeof(QFixedPoint));
215 memset(glyphs + first, 0, num * sizeof(glyph_t));
216 memset(static_cast<void *>(advances + first), 0, num * sizeof(QFixed));
217 memset(static_cast<void *>(justifications + first), 0, num * sizeof(QGlyphJustification));
218 memset(attributes + first, 0, num * sizeof(QGlyphAttributes));
219 }
220 }
221
222 inline char *data() {
223 return reinterpret_cast<char *>(offsets);
224 }
225
226 void copy(QGlyphLayout *other);
227 void grow(char *address, int totalGlyphs);
228};
229
231{
232private:
233 typedef QVarLengthArray<void *> Array;
234public:
236 : Array((totalGlyphs * SpaceNeeded) / sizeof(void *) + 1)
237 , QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs)
238 {
239 memset(Array::data(), 0, Array::size() * sizeof(void *));
240 }
241
242 void resize(int totalGlyphs)
243 {
244 Array::resize((totalGlyphs * SpaceNeeded) / sizeof(void *) + 1);
245
246 *((QGlyphLayout *)this) = QGlyphLayout(reinterpret_cast<char *>(Array::data()), totalGlyphs);
247 memset(Array::data(), 0, Array::size() * sizeof(void *));
248 }
249};
250
251template <int N> struct QGlyphLayoutArray : public QGlyphLayout
252{
253public:
255 : QGlyphLayout(reinterpret_cast<char *>(buffer), N)
256 {
257 memset(buffer, 0, sizeof(buffer));
258 }
259
260private:
261 void *buffer[(N * SpaceNeeded) / sizeof(void *) + 1];
262};
263
264struct QScriptItem;
265/// Internal QTextItem
267{
268public:
269 inline QTextItemInt() = default;
270 QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format = QTextCharFormat());
271 QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe,
272 const QTextCharFormat &format = QTextCharFormat());
273
274 /// copy the structure items, adjusting the glyphs arrays to the right subarrays.
275 /// the width of the returned QTextItemInt is not adjusted, for speed reasons
276 QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const;
277 void initWithScriptItem(const QScriptItem &si);
278
282
284 bool justified = false;
286 const QTextCharFormat charFormat;
287 int num_chars = 0;
288 const QChar *chars = nullptr;
289 const unsigned short *logClusters = nullptr;
290 const QFont *f = nullptr;
291
294};
295
297{
298 constexpr QScriptItem(int p, QScriptAnalysis a) noexcept
299 : position(p), analysis(a),
300 num_glyphs(0), descent(-1), ascent(-1), leading(-1), width(-1),
302
305 unsigned short num_glyphs;
311 constexpr QFixed height() const noexcept { return ascent + descent; }
312private:
313 friend class QList<QScriptItem>;
314 QScriptItem() {} // for QList, don't use
315};
317
319
320struct Q_AUTOTEST_EXPORT QScriptLine
321{
322 // created and filled in QTextLine::layout_helper
323 QScriptLine()
324 : from(0), trailingSpaces(0), length(0),
325 justified(0), gridfitted(0),
326 hasTrailingSpaces(0), leadingIncluded(0) {}
327 QFixed descent;
335 int from;
336 unsigned short trailingSpaces;
337 signed int length : 28;
338 mutable uint justified : 1;
339 mutable uint gridfitted : 1;
342 QFixed height() const { return ascent + descent
343 + (leadingIncluded? qMax(QFixed(),leading) : QFixed()); }
344 QFixed base() const { return ascent; }
345 void setDefaultHeight(QTextEngine *eng);
346 void operator+=(const QScriptLine &other);
347};
348Q_DECLARE_TYPEINFO(QScriptLine, Q_PRIMITIVE_TYPE);
349
350
351inline void QScriptLine::operator+=(const QScriptLine &other)
352{
353 leading= qMax(leading + ascent, other.leading + other.ascent) - qMax(ascent, other.ascent);
354 descent = qMax(descent, other.descent);
355 ascent = qMax(ascent, other.ascent);
356 textWidth += other.textWidth;
357 length += other.length;
358}
359
361
362class QFontPrivate;
363class QTextFormatCollection;
364
365class Q_GUI_EXPORT QTextEngine {
366public:
367 enum LayoutState {
368 LayoutEmpty,
369 InLayout,
370 LayoutFailed
371 };
372 struct Q_GUI_EXPORT LayoutData {
373 LayoutData(const QString &str, void **stack_memory, qsizetype mem_size);
374 LayoutData();
375 ~LayoutData();
376 mutable QScriptItemArray items;
377 qsizetype allocated;
378 qsizetype available_glyphs;
379 void **memory;
380 unsigned short *logClustersPtr;
381 QGlyphLayout glyphLayout;
382 mutable int used;
383 uint hasBidi : 1;
384 uint layoutState : 2;
385 uint memory_on_stack : 1;
386 uint haveCharAttributes : 1;
387 QFixed currentMaxWidth;
388 QString string;
389 bool reallocate(int totalGlyphs);
390 };
391
392 struct ItemDecoration {
393 ItemDecoration() { } // for QList, don't use
394 ItemDecoration(qreal x1, qreal x2, qreal y, const QPen &pen):
395 x1(x1), x2(x2), y(y), pen(pen) {}
396
397 qreal x1;
398 qreal x2;
399 qreal y;
400 QPen pen;
401 };
402
403 typedef QList<ItemDecoration> ItemDecorationList;
404
405 QTextEngine();
406 QTextEngine(const QString &str, const QFont &f);
407 ~QTextEngine();
408
409 enum Mode {
410 WidthOnly = 0x07
411 };
412
413 void invalidate();
414 void clearLineData();
415
416 void validate() const;
417 void itemize() const;
418
419 bool isRightToLeft() const;
420 static void bidiReorder(int numRuns, const quint8 *levels, int *visualOrder);
421
422 const QCharAttributes *attributes() const;
423
424 void shape(int item) const;
425
426 void justify(const QScriptLine &si);
427 QFixed alignLine(const QScriptLine &line);
428
429 QFixed width(int charFrom, int numChars) const;
430 glyph_metrics_t boundingBox(int from, int len) const;
431 glyph_metrics_t tightBoundingBox(int from, int len) const;
432
433 int length(int item) const {
434 const QScriptItem &si = layoutData->items[item];
435 int from = si.position;
436 item++;
437 return (item < layoutData->items.size() ? layoutData->items[item].position : layoutData->string.size()) - from;
438 }
439 int length(const QScriptItem *si) const {
440 int end;
441 if (si + 1 < layoutData->items.constData()+ layoutData->items.size())
442 end = (si+1)->position;
443 else
444 end = layoutData->string.size();
445 return end - si->position;
446 }
447
448 QFontEngine *fontEngine(const QScriptItem &si, QFixed *ascent = nullptr, QFixed *descent = nullptr, QFixed *leading = nullptr) const;
449 QFont font(const QScriptItem &si) const;
450 inline QFont font() const { return fnt; }
451
452 /**
453 * Returns a pointer to an array of log clusters, offset at the script item.
454 * Each item in the array is a unsigned short. For each character in the original string there is an entry in the table
455 * so there is a one to one correlation in indexes between the original text and the index in the logcluster.
456 * The value of each item is the position in the glyphs array. Multiple similar pointers in the logclusters array imply
457 * that one glyph is used for more than one character.
458 * \sa glyphs()
459 */
460 inline unsigned short *logClusters(const QScriptItem *si) const
461 { return layoutData->logClustersPtr+si->position; }
462 /**
463 * Returns an array of QGlyphLayout items, offset at the script item.
464 * Each item in the array matches one glyph in the text, storing the advance, position etc.
465 * The returned item's length equals to the number of available glyphs. This may be more
466 * than what was actually shaped.
467 * \sa logClusters()
468 */
469 inline QGlyphLayout availableGlyphs(const QScriptItem *si) const {
470 return layoutData->glyphLayout.mid(si->glyph_data_offset);
471 }
472 /**
473 * Returns an array of QGlyphLayout items, offset at the script item.
474 * Each item in the array matches one glyph in the text, storing the advance, position etc.
475 * The returned item's length equals to the number of shaped glyphs.
476 * \sa logClusters()
477 */
478 inline QGlyphLayout shapedGlyphs(const QScriptItem *si) const {
479 return layoutData->glyphLayout.mid(si->glyph_data_offset, si->num_glyphs);
480 }
481
482 inline bool ensureSpace(int nGlyphs) const {
483 if (layoutData->glyphLayout.numGlyphs - layoutData->used < nGlyphs)
484 return layoutData->reallocate((((layoutData->used + nGlyphs)*3/2 + 15) >> 4) << 4);
485 return true;
486 }
487
488 void freeMemory();
489
490 int findItem(int strPos, int firstItem = 0) const;
491 inline QTextFormatCollection *formatCollection() const {
492 if (QTextDocumentPrivate::get(block) != nullptr)
493 return const_cast<QTextFormatCollection *>(QTextDocumentPrivate::get(block)->formatCollection());
494 return specialData ? specialData->formatCollection.data() : nullptr;
495 }
496 QTextCharFormat format(const QScriptItem *si) const;
497 inline QAbstractTextDocumentLayout *docLayout() const {
498 Q_ASSERT(QTextDocumentPrivate::get(block) != nullptr);
499 return QTextDocumentPrivate::get(block)->document()->documentLayout();
500 }
501 int formatIndex(const QScriptItem *si) const;
502
503 /// returns the width of tab at index (in the tabs array) with the tab-start at position x
504 QFixed calculateTabWidth(int index, QFixed x) const;
505
506 mutable QScriptLineArray lines;
507
508private:
509 struct FontEngineCache {
510 FontEngineCache();
511 mutable QFontEngine *prevFontEngine;
512 mutable QFontEngine *prevScaledFontEngine;
513 mutable int prevScript;
514 mutable int prevPosition;
515 mutable int prevLength;
516 inline void reset() {
517 prevFontEngine = nullptr;
518 prevScaledFontEngine = nullptr;
519 prevScript = -1;
520 prevPosition = -1;
521 prevLength = -1;
522 }
523 };
524 mutable FontEngineCache feCache;
525
526public:
527 QString text;
528 mutable QFont fnt;
529#ifndef QT_NO_RAWFONT
530 QRawFont rawFont;
531#endif
532 QTextBlock block;
533
534 QTextOption option;
535
536 QFixed minWidth;
537 QFixed maxWidth;
538 QPointF position;
539 uint ignoreBidi : 1;
540 uint cacheGlyphs : 1;
541 uint stackEngine : 1;
542 uint forceJustification : 1;
543 uint visualMovement : 1;
544 uint delayDecorations: 1;
545#ifndef QT_NO_RAWFONT
546 uint useRawFont : 1;
547#endif
548
549 mutable LayoutData *layoutData;
550
551 ItemDecorationList underlineList;
552 ItemDecorationList strikeOutList;
553 ItemDecorationList overlineList;
554
555 inline bool visualCursorMovement() const
556 { return visualMovement || (QTextDocumentPrivate::get(block) != nullptr && QTextDocumentPrivate::get(block)->defaultCursorMoveStyle == Qt::VisualMoveStyle); }
557
558 inline int preeditAreaPosition() const { return specialData ? specialData->preeditPosition : -1; }
559 inline QString preeditAreaText() const { return specialData ? specialData->preeditText : QString(); }
560 void setPreeditArea(int position, const QString &text);
561
562 inline bool hasFormats() const
563 { return QTextDocumentPrivate::get(block) != nullptr || (specialData && !specialData->formats.isEmpty()); }
564 inline QList<QTextLayout::FormatRange> formats() const
565 {
566 return specialData ? specialData->formats : QList<QTextLayout::FormatRange>();
567 }
568 void setFormats(const QList<QTextLayout::FormatRange> &formats);
569
570private:
571 static void init(QTextEngine *e);
572
573 struct SpecialData {
574 int preeditPosition;
575 QString preeditText;
576 QList<QTextLayout::FormatRange> formats;
577 QList<QTextCharFormat> resolvedFormats;
578 // only used when no QTextDocumentPrivate is available
579 QScopedPointer<QTextFormatCollection> formatCollection;
580 };
581 SpecialData *specialData;
582
583 void indexFormats();
584 void resolveFormats() const;
585
586public:
587 bool atWordSeparator(int position) const;
588
589 QString elidedText(Qt::TextElideMode mode, QFixed width, int flags = 0, int from = 0, int count = -1) const;
590
591 void shapeLine(const QScriptLine &line);
592 QFixed leadingSpaceWidth(const QScriptLine &line);
593
594 QFixed offsetInLigature(const QScriptItem *si, int pos, int max, int glyph_pos);
595 int positionInLigature(const QScriptItem *si, int end, QFixed x, QFixed edge, int glyph_pos, bool cursorOnCharacter);
596 int previousLogicalPosition(int oldPos) const;
597 int nextLogicalPosition(int oldPos) const;
598 int lineNumberForTextPosition(int pos);
599 int positionAfterVisualMovement(int oldPos, QTextCursor::MoveOperation op);
600 std::vector<int> insertionPointsForLine(int lineNum);
601 void resetFontEngineCache();
602
603 void enableDelayDecorations(bool enable = true) { delayDecorations = enable; }
604
605 void addUnderline(QPainter *painter, const QLineF &line);
606 void addStrikeOut(QPainter *painter, const QLineF &line);
607 void addOverline(QPainter *painter, const QLineF &line);
608
609 void drawDecorations(QPainter *painter);
610 void clearDecorations();
611 void adjustUnderlines();
612
613private:
614 void addItemDecoration(QPainter *painter, const QLineF &line, ItemDecorationList *decorationList);
615 void adjustUnderlines(ItemDecorationList::iterator start,
616 ItemDecorationList::iterator end,
617 qreal underlinePos, qreal penWidth);
618 void drawItemDecorationList(QPainter *painter, const ItemDecorationList &decorationList);
619 void setBoundary(int strPos) const;
620 void addRequiredBoundaries() const;
621 void shapeText(int item) const;
622#if QT_CONFIG(harfbuzz)
623 int shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *string, int stringBaseIndex,
624 int stringLength, int itemLength, QFontEngine *fontEngine,
625 QSpan<uint> itemBoundaries, bool kerningEnabled,
626 bool hasLetterSpacing,
627 const QHash<QFont::Tag, quint32> &features) const;
628#endif
629
630 int endOfLine(int lineNum);
631 int beginningOfLine(int lineNum);
632 int getClusterLength(unsigned short *logClusters, const QCharAttributes *attributes, int from, int to, int glyph_pos, int *start);
633};
634
635class Q_GUI_EXPORT QStackTextEngine : public QTextEngine {
636public:
637 enum { MemSize = 256*40/sizeof(void *) };
638 QStackTextEngine(const QString &string, const QFont &f);
639 LayoutData _layoutData;
640 void *_memory[MemSize];
641};
642Q_DECLARE_TYPEINFO(QTextEngine::ItemDecoration, Q_RELOCATABLE_TYPE);
643
645{
646 QTextLineItemIterator(QTextEngine *eng, int lineNum, const QPointF &pos = QPointF(),
647 const QTextLayout::FormatRange *_selection = nullptr);
648
649 inline bool atEnd() const { return logicalItem >= nItems - 1; }
650 inline bool atBeginning() const { return logicalItem <= 0; }
651 QScriptItem &next();
652
653 bool getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const;
654 inline bool isOutsideSelection() const {
655 QFixed tmp1, tmp2;
656 return !getSelectionBounds(&tmp1, &tmp2);
657 }
658
660
664
665 const int lineNum;
666 const int lineEnd;
667 const int firstItem;
668 const int lastItem;
669 const int nItems;
671 int item;
673
678
680
682
684};
685
686QT_END_NAMESPACE
687
688#endif // QTEXTENGINE_P_H
friend class QPainter
friend class QFontEngine
Definition qpainter.h:432
QTextBlockUserData * userData
QTextLayout * layout
void invalidate() const
signed int revision
void invalidate() const
QString toHtml(ExportMode mode=ExportEntireDocument)
Returns the document in HTML format.
QTextHtmlExporter(const QTextDocument *_doc)
Internal QTextItem.
void initWithScriptItem(const QScriptItem &si)
RenderFlags flags
const QTextCharFormat charFormat
QTextItemInt midItem(QFontEngine *fontEngine, int firstGlyphIndex, int numGlyphs) const
const QChar * chars
QGlyphLayout glyphs
const QFont * f
const unsigned short * logClusters
QTextCharFormat::UnderlineStyle underlineStyle
QTextItemInt(const QGlyphLayout &g, QFont *font, const QChar *chars, int numChars, QFontEngine *fe, const QTextCharFormat &format=QTextCharFormat())
QTextItemInt()=default
QFontEngine * fontEngine
QTextItemInt(const QScriptItem &si, QFont *font, const QTextCharFormat &format=QTextCharFormat())
The QTextObjectInterface class allows drawing of custom text objects in \l{QTextDocument}...
QAbstractUndoItem * custom
bool tryMerge(const QTextUndoCommand &other)
QVarLengthGlyphLayoutArray(int totalGlyphs)
void resize(int totalGlyphs)
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QTextUndoCommand, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QGlyphAttributes, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QScriptItem, Q_PRIMITIVE_TYPE)
QList< QScriptItem > QScriptItemArray
QList< QScriptLine > QScriptLineArray
Q_DECLARE_TYPEINFO(QGlyphJustification, Q_PRIMITIVE_TYPE)
QGlyphJustification * justifications
void grow(char *address, int totalGlyphs)
QFixed effectiveAdvance(int item) const
void copy(QGlyphLayout *other)
QGlyphLayout(char *address, int totalGlyphs)
void clear(int first=0, int last=-1)
static constexpr qsizetype SpaceNeeded
QGlyphAttributes * attributes
glyph_t * glyphs
QGlyphLayout mid(int position, int n=-1) const
QFixedPoint * offsets
QFixed * advances
int width
Definition qimage_p.h:45
constexpr QScriptItem(int p, QScriptAnalysis a) noexcept
QScriptAnalysis analysis
constexpr QFixed height() const noexcept
unsigned short num_glyphs
void setDefaultHeight(QTextEngine *eng)
QFixed base() const
void operator+=(const QScriptLine &other)
QFixed height() const
signed int length
QFixed textAdvance
unsigned short trailingSpaces
uint hasTrailingSpaces
bool getSelectionBounds(QFixed *selectionX, QFixed *selectionWidth) const
QTextLineItemIterator(QTextEngine *eng, int lineNum, const QPointF &pos=QPointF(), const QTextLayout::FormatRange *_selection=nullptr)
const QTextLayout::FormatRange * selection
const QScriptLine & line
QVarLengthArray< int > visualOrder
bool isOutsideSelection() const