5#include <private/qfontengine_p.h>
6#include <private/qfontengineglyphcache_p.h>
7#include <private/qguiapplication_p.h>
9#include <qpa/qplatformfontdatabase.h>
10#include <qpa/qplatformintegration.h>
19#include <private/qstringiterator_p.h>
21#if QT_CONFIG(harfbuzz)
41 return a.m11() ==
b.m11()
44 &&
a.m22() ==
b.m22();
76#ifdef QT_BUILD_INTERNAL
78static QList<QFontEngine *> *enginesCollector =
nullptr;
82 delete enginesCollector;
83 enginesCollector =
new QList<QFontEngine *>();
89 QList<QFontEngine *>
ret = *enginesCollector;
90 delete enginesCollector;
91 enginesCollector =
nullptr;
99#define kBearingNotInitialized std::numeric_limits<qreal>::max()
105 m_heightMetricsQueried(
false),
120#ifdef QT_BUILD_INTERNAL
121 if (enginesCollector)
122 enginesCollector->append(
this);
128#ifdef QT_BUILD_INTERNAL
129 if (enginesCollector)
130 enginesCollector->removeOne(
this);
138 int lw = score / 700;
141 if (lw < 2 && score >= 1050) lw = 2;
155#if QT_CONFIG(harfbuzz)
165#if QT_CONFIG(harfbuzz)
183#if QT_CONFIG(harfbuzz)
185 uint lenMort = 0, lenMorx = 0;
192 unsigned int script_count = HB_OT_MAX_TAGS_PER_SCRIPT;
193 hb_tag_t script_tags[HB_OT_MAX_TAGS_PER_SCRIPT];
196 &script_count, script_tags,
199 if (hb_ot_layout_table_select_script(
face, HB_OT_TAG_GSUB, script_count, script_tags,
nullptr,
nullptr))
209 while (
it.hasNext()) {
259 QVarLengthArray<glyph_t> &glyphs_out, QVarLengthArray<QFixedPoint> &
positions)
276 int totalKashidas = 0;
284 glyphs_out.resize(glyphs.
numGlyphs+totalKashidas);
297 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
304 glyphs_out[current] = glyphs.
glyphs[
i];
314 g.glyphs = &kashidaGlyph;
315 g.advances = &kashidaWidth;
319 xpos -= kashidaWidth;
324 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
331 glyphs_out[current] = kashidaGlyph;
348 glyphs_out[current] = glyphs.
glyphs[
i];
359 QPointF gpos(gpos_x.toReal(), gpos_y.toReal());
363 glyphs_out[current] = glyphs.
glyphs[
i];
372 glyphs_out.resize(current);
379 if (leftBearing !=
nullptr)
380 *leftBearing = gi.leftBearing().toReal();
381 if (rightBearing !=
nullptr)
382 *rightBearing = gi.rightBearing().toReal();
388 if (hhea.
size() >= 10) {
412 bool hasEmbeddedBitmaps =
416 if (!hasEmbeddedBitmaps) {
436 if (os2.size() >= 78) {
437 auto ptr = os2.constData();
438 quint16 fsSelection = qFromBigEndian<quint16>(
ptr + 62);
439 qint16 typoAscent = qFromBigEndian<qint16>(
ptr + 68);
440 qint16 typoDescent = qFromBigEndian<qint16>(
ptr + 70);
441 qint16 typoLineGap = qFromBigEndian<qint16>(
ptr + 72);
442 quint16 winAscent = qFromBigEndian<quint16>(
ptr + 74);
443 quint16 winDescent = qFromBigEndian<quint16>(
ptr + 76);
445 enum { USE_TYPO_METRICS = 0x80 };
447 if (fsSelection & USE_TYPO_METRICS) {
449 if (typoAscent == 0 && typoDescent == 0)
456 if (winAscent == 0 && winDescent == 0)
498 return m_minLeftBearing;
501#define q16Dot16ToFloat(i) ((i) / 65536.0)
503#define kMinLeftSideBearingOffset 12
504#define kMinRightSideBearingOffset 14
513 const uchar *tableData =
reinterpret_cast<const uchar *
>(hheaTable.constData());
529 static const int largestValidBearing = 4 * unitsPerEm;
531 if (
qAbs(minLeftSideBearing) < largestValidBearing)
532 m_minLeftBearing = minLeftSideBearing * funitToPixelFactor;
533 if (
qAbs(minRightSideBearing) < largestValidBearing)
534 m_minRightBearing = minRightSideBearing * funitToPixelFactor;
543 static const ushort characterSubset[] = {
544 '(',
'C',
'F',
'K',
'V',
'X',
'Y',
']',
'_',
'f',
'r',
'|',
545 127, 205, 645, 884, 922, 1070, 12386
549 m_minLeftBearing = m_minRightBearing = std::numeric_limits<qreal>::max();
551 for (
uint i = 0;
i < (
sizeof(characterSubset) /
sizeof(
ushort)); ++
i) {
568 qWarning() <<
"Failed to compute left/right minimum bearings for"
572 return m_minRightBearing;
598 overall.x =
qMin(overall.x,
x);
599 overall.y =
qMin(overall.y,
y);
603 overall.yoff += bb.yoff;
605 overall.height =
qMax(overall.height, ymax - overall.y);
606 overall.width = xmax - overall.x;
613 QTextItem::RenderFlags
flags)
619 QVarLengthArray<glyph_t> positioned_glyphs;
625#define GRID(x, y) grid[(y)*(w+1) + (x)]
626#define SET(x, y) (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)))
677 path->closeSubpath();
684 for (
int y = 0;
y <=
h; ++
y) {
685 for (
int x = 0;
x <=
w; ++
x) {
686 bool topLeft = (
x == 0 ||
y == 0) ?
false :
SET(
x - 1,
y - 1);
687 bool topRight = (
x ==
w ||
y == 0) ?
false :
SET(
x,
y - 1);
688 bool bottomLeft = (
x == 0 ||
y ==
h) ?
false :
SET(
x - 1,
y);
689 bool bottomRight = (
x ==
w ||
y ==
h) ?
false :
SET(
x,
y);
692 if ((!topRight) & bottomRight)
694 if ((!bottomRight) & bottomLeft)
696 if ((!bottomLeft) & topLeft)
698 if ((!topLeft) & topRight)
704 for (
int y = 0;
y <
h; ++
y) {
705 for (
int x = 0;
x <
w; ++
x) {
734 const int w = alphaMask.
width();
735 const int h = alphaMask.
height();
738 if (alphaMask.
depth() == 1) {
746 for (
int yi = 0; yi <
h; ++yi) {
748 uchar *
dst = bitmapData + yi*destBpl;
749 for (
int xi = 0; xi <
w; ++xi) {
750 const int byte = xi / 8;
751 const int bit = xi % 8;
755 dst[byte] |= 128 >> bit;
775 for (
int i = 0;
i < nGlyphs - 1; ++
i) {
776 g.glyphs[
i] = glyphs[
i];
779 g.glyphs[nGlyphs - 1] = glyphs[nGlyphs - 1];
819 for (
int y=0;
y<alphaMask.
height(); ++
y) {
822 for (
int x=0;
x<alphaMask.
width(); ++
x) {
869 int glyph_x =
qFloor(gm.x.toReal());
870 int glyph_y =
qFloor(gm.y.toReal());
871 int glyph_width =
qCeil((gm.x + gm.width).toReal()) - glyph_x;
872 int glyph_height =
qCeil((gm.y + gm.height).toReal()) - glyph_y;
874 if (glyph_width <= 0 || glyph_height <= 0)
916 p.emSquare =
p.ascent;
919 p.capHeight =
p.ascent;
975 if (
cache == e.cache.data())
984 GlyphCacheEntry
entry;
1019 if (pairs[middle].left_right == left_right)
1020 return pairs[middle].
adjust;
1022 if (pairs[middle].left_right < left_right)
1073 for(
int i = 0;
i < numTables; ++
i) {
1089 if (version == 0 && coverage == 0x0001) {
1100 if (nPairs * 6 + 8 >
length - 6) {
1107 for(
int i = 0;
i < nPairs; ++
i) {
1118 p.left_right |= tmp;
1123 p.adjust =
QFixed(
int(
short(tmp))) / scalingFactor;
1141 if (maxpTable.size() < 6)
1144 const uchar *
source =
reinterpret_cast<const uchar *
>(maxpTable.constData() + 4);
1180 MicrosoftUnicodeExtended
1183 int symbolTable = -1;
1184 int tableToUse = -1;
1186 for (
int n = 0;
n < numTables; ++
n) {
1191 quint16 platformSpecificId = 0;
1195 switch (platformId) {
1197 if (score < Unicode &&
1198 (platformSpecificId == 0 ||
1199 platformSpecificId == 2 ||
1200 platformSpecificId == 3)) {
1203 }
else if (score < Unicode11 && platformSpecificId == 1) {
1209 if (score < AppleRoman && platformSpecificId == 0) {
1215 switch (platformSpecificId) {
1224 if (score < MicrosoftUnicode) {
1226 score = MicrosoftUnicode;
1230 if (score < MicrosoftUnicodeExtended) {
1232 score = MicrosoftUnicodeExtended;
1247 *isSymbolFont = (symbolTable > -1);
1281 if (symbolTable > -1 && ((score == Unicode) || (score == Unicode11))) {
1282 const uchar *selectedTable =
table + unicode_table;
1285 bool unicodeTableHasLatin1 =
false;
1286 for (
int uc=0x00; uc<0x100; ++uc) {
1288 unicodeTableHasLatin1 =
true;
1294 bool unicodeTableHasSymbols =
false;
1295 if (!unicodeTableHasLatin1) {
1296 for (
int uc=0xf000; uc<0xf100; ++uc) {
1298 unicodeTableHasSymbols =
true;
1305 if (!unicodeTableHasLatin1 && unicodeTableHasSymbols) {
1306 tableToUse = symbolTable;
1312 return table + unicode_table;
1317 const uchar *
end = cmap + cmapSize;
1323 const uchar *
ptr = cmap + 6 + unicode;
1324 if (unicode < 256 &&
ptr <
end)
1326 }
else if (
format == 4) {
1332 if (unicode >= 0xffff)
1339 const unsigned char *ends = cmap + 14;
1342 for (;
i < segCountX2/2; ++
i) {
1346 if (codePoint >= unicode)
1350 const unsigned char *idx = ends + segCountX2 + 2 + 2*
i;
1355 if (startIndex > unicode)
1372 if (idRangeoffset_t) {
1385 }
else if (
format == 6) {
1393 if (unicode < firstCode6)
1399 if (entryCount6 * 2 + 10 > tableSize)
1402 quint16 sentinel6 = firstCode6 + entryCount6;
1403 if (unicode >= sentinel6)
1406 quint16 entryIndex6 = unicode - firstCode6;
1411 }
else if (
format == 12) {
1426 if (unicode < startCharCode)
1433 if (unicode <= endCharCode) {
1438 return index + unicode - startCharCode;
1444 qDebug(
"cmap table of format %d not implemented",
format);
1481 if (gi.isValid() && gi.width > 0)
1482 return gi.leftBearing();
1493 return gi.rightBearing();
1499QFontEngine::GlyphCacheEntry::GlyphCacheEntry()
1503QFontEngine::GlyphCacheEntry::GlyphCacheEntry(
const GlyphCacheEntry &
o)
1508QFontEngine::GlyphCacheEntry::~GlyphCacheEntry()
1512QFontEngine::GlyphCacheEntry &QFontEngine::GlyphCacheEntry::operator=(
const GlyphCacheEntry &
o)
1549 if (*nglyphs <
len) {
1556 while (
it.hasNext()) {
1558 glyphs->
glyphs[ucs4Length++] = 1;
1561 *nglyphs = ucs4Length;
1582 QVarLengthArray<glyph_t> positioned_glyphs;
1586 QSize s(_size - 3, _size - 3);
1587 for (
int k = 0; k <
positions.size(); k++)
1595 overall.height = _size;
1596 overall.xoff = overall.width;
1602 if (!ti.glyphs.numGlyphs)
1606 QSize s(_size - 3, _size - 3);
1609 QVarLengthArray<glyph_t> glyphs;
1611 ti.fontEngine->getGlyphPositions(ti.glyphs,
matrix, ti.flags, glyphs,
positions);
1612 if (glyphs.size() == 0)
1622 for (
int k = 0; k <
positions.size(); k++)
1675 for (
int i=2;
i <= _size-3; ++
i) {
1677 bits[
i + (_size - 3) *
image.bytesPerLine()] = 255;
1679 bits[_size - 3 +
i *
image.bytesPerLine()] = 255;
1689{
return glyph >> 24; }
1693{
return glyph & 0x00ffffff; }
1697 m_fallbackFamilies(fallbackFamilies),
1699 m_fallbackFamiliesQueried(!m_fallbackFamilies.isEmpty())
1703 if (m_fallbackFamilies.isEmpty()) {
1705 m_fallbackFamilies <<
QString();
1708 m_engines.
resize(m_fallbackFamilies.size() + 1);
1719 for (
int i = 0;
i < m_engines.
size(); ++
i) {
1721 if (fontEngine && !fontEngine->
ref.
deref())
1736 QChar::Script(m_script)));
1741 Q_ASSERT(!m_fallbackFamiliesQueried);
1743 m_fallbackFamilies = fallbackFamilies;
1744 if (m_fallbackFamilies.isEmpty()) {
1752 m_engines.
resize(m_fallbackFamilies.size() + 1);
1755 m_fallbackFamiliesQueried =
true;
1760 if (!m_fallbackFamiliesQueried &&
at > 0)
1763 if (!m_engines.
at(
at)) {
1798 if (!m_fallbackFamiliesQueried)
1800 for (
int x = 1,
n =
qMin(m_engines.
size(), 256);
x <
n; ++
x) {
1812 glyph =
engine->glyphIndex(ucs4);
1826 QFontEngine::ShaperFlags
flags)
const
1828 const int originalNumGlyphs = glyphs->
numGlyphs;
1829 int mappedGlyphCount =
engine(0)->stringToCMap(
str,
len, glyphs, nglyphs,
flags);
1830 if (mappedGlyphCount < 0)
1836 if (contextFontMerging) {
1838 if (!m_fallbackFamiliesQueried)
1841 int maxGlyphCount = 0;
1842 uchar engineIndex = 0;
1843 for (
int x = 1,
n =
qMin(m_engines.
size(), 256);
x <
n; ++
x) {
1849 if (maxGlyphCount > mappedGlyphCount) {
1852 glyphs->
copy(&tempLayout);
1859 if (engineIndex > 0) {
1862 glyphs->
glyphs[
y] |= (engineIndex << 24);
1865 contextFontMerging =
false;
1868 mappedGlyphCount = maxGlyphCount;
1876 int lastFallback = -1;
1877 char32_t previousUcs4 = 0;
1878 while (
it.hasNext()) {
1879 const char32_t ucs4 =
it.peekNext();
1884 if (lastFallback >= 0 && (ucs4 == 0x200d || ucs4 == 0x200c)) {
1888 glyphs->
glyphs[glyph_pos] = glyph;
1895 glyphs->
glyphs[glyph_pos] |= (lastFallback << 24);
1904 if (!m_fallbackFamiliesQueried)
1906 for (
int x = contextFontMerging ? 0 : 1,
n =
qMin(m_engines.
size(), 256);
x <
n; ++
x) {
1922 glyphs->
glyphs[glyph_pos] = glyph;
1931 glyphs->
glyphs[glyph_pos] |= (
x << 24);
1939 const int variantSelectorBlock = 0xFE00;
1940 if ((ucs4 & 0xFFF0) == variantSelectorBlock && glyph_pos > 0) {
1941 int selectorFontEngine = glyphs->
glyphs[glyph_pos] >> 24;
1942 int precedingCharacterFontEngine = glyphs->
glyphs[glyph_pos - 1] >> 24;
1944 if (selectorFontEngine != precedingCharacterFontEngine) {
1950 const QFontEngine *selectedEngine = m_engines.
at(precedingCharacterFontEngine);
1951 const bool colorFont = selectedEngine->
isColorFont();
1952 const char32_t vs15 = 0xFE0E;
1953 const char32_t vs16 = 0xFE0F;
1954 bool adaptVariantSelector = ucs4 < vs15
1955 || (ucs4 == vs15 && colorFont)
1956 || (ucs4 == vs16 && !colorFont);
1958 if (adaptVariantSelector) {
1962 glyphs->
glyphs[glyph_pos - 1] = glyph;
1969 glyphs->
glyphs[glyph_pos - 1] |= (selectorFontEngine << 24);
1978 previousUcs4 = ucs4;
1981 *nglyphs = glyph_pos;
1983 return mappedGlyphCount;
2015 overall.x =
qMin(overall.x, gm.x);
2016 overall.y =
qMin(overall.y, gm.y);
2017 overall.width = overall.xoff + gm.width;
2018 overall.height =
qMax(overall.height + overall.y, gm.height + gm.y) -
2019 qMin(overall.y, gm.y);
2020 overall.xoff += gm.xoff;
2021 overall.yoff += gm.yoff;
2024 const int hi = which << 24;
2040 overall.x =
qMin(overall.x, gm.x);
2041 overall.y =
qMin(overall.y, gm.y);
2042 overall.width = overall.xoff + gm.width;
2043 overall.height =
qMax(overall.height + overall.y, gm.height + gm.y) -
2044 qMin(overall.y, gm.y);
2045 overall.xoff += gm.xoff;
2046 overall.yoff += gm.yoff;
2049 const int hi = which << 24;
2060 engine(which)->getGlyphBearings(
stripped(glyph), leftBearing, rightBearing);
2073 for (
int gl = 0; gl < glyphs.
numGlyphs; gl++)
2091 const int hi = which << 24;
2117 const int hi = which << 24;
2143 const int hi = which << 24;
2160 const int hi = which << 24;
2186 const int hi = which << 24;
2203 const int hi = which << 24;
2215{
return engine(0)->ascent(); }
2218{
return engine(0)->capHeight(); }
2221{
return engine(0)->descent(); }
2225 return engine(0)->leading();
2230 return engine(0)->xHeight();
2235 return engine(0)->averageCharWidth();
2240 return engine(0)->lineThickness();
2245 return engine(0)->underlinePosition();
2250 return engine(0)->maxCharWidth();
2255 return engine(0)->minLeftBearing();
2260 return engine(0)->minRightBearing();
2270 QVarLengthArray<glyph_t> glyphs(nglyphs);
2274 g.glyphs = glyphs.data();
2278 for (
int i = 0;
i < nglyphs;
i++) {
2298 return engine(which)->alphaMapForGlyph(
stripped(glyph), subPixelPosition);
2312 return engine(which)->alphaMapForGlyph(
stripped(glyph), subPixelPosition,
t);
2320 return engine(which)->alphaRGBMapForGlyph(
stripped(glyph), subPixelPosition,
t);
2341 const bool faceIsLocal = !fe->faceId().filename.isEmpty();
2343 end = fc->engineCache.end();
2347 if (fe == cachedEngine->engine(0) || (faceIsLocal && fe->faceId().filename == cachedEngine->engine(0)->faceId().filename)) {
2349 fc->updateHitCountAndTimeStamp(
it.value());
2356 fc->insertEngine(
key,
engine, !faceIsLocal);
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
QByteArray & replace(qsizetype index, qsizetype len, const char *s, qsizetype alen)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QColor class provides colors based on RGB, HSV or CMYK values.
static QFontCache * instance()
static QFontEngine * findFont(const QFontDef &request, int script, bool preferScriptOverFamily=false)
void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si)
virtual QImage alphaMapForGlyph(glyph_t) override
virtual qreal maxCharWidth() const override
virtual QFontEngine * cloneWithSize(qreal pixelSize) 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 glyph_t glyphIndex(uint ucs4) const override
virtual QFixed descent() const override
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override
virtual QFixed ascent() const override
virtual QFixed capHeight() const override
void ensureEngineAt(int at)
virtual int stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override
virtual glyph_t glyphIndex(uint ucs4) const override
virtual bool shouldLoadFontEngineForCharacter(int at, uint ucs4) const
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const override
virtual QFixed ascent() const override
virtual QFixed capHeight() const override
QString fallbackFamilyAt(int at) const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs) override
virtual QFixed descent() const override
virtual QFixed leading() const override
virtual QFixed lineThickness() const override
virtual bool canRender(const QChar *string, int len) const override
virtual qreal maxCharWidth() const override
virtual QFixed xHeight() const override
static QFontEngine * createMultiFontEngine(QFontEngine *fe, int script)
virtual void ensureFallbackFamiliesQueried()
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override
virtual qreal minLeftBearing() const override
virtual void doKerning(QGlyphLayout *, ShaperFlags) const override
void setFallbackFamiliesList(const QStringList &fallbackFamilies)
virtual qreal minRightBearing() const override
virtual QFixed underlinePosition() const override
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=nullptr, qreal *rightBearing=nullptr) override
virtual QImage alphaMapForGlyph(glyph_t) override
QFontEngineMulti(QFontEngine *engine, int script, const QStringList &fallbackFamilies=QStringList())
virtual QFontEngine * loadEngine(int at)
virtual QFixed averageCharWidth() const override
static uchar highByte(glyph_t glyph)
virtual QImage alphaRGBMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override
glyph_metrics_t tightBoundingBox(const QGlyphLayout &glyphs)
virtual bool supportsHorizontalSubPixelPositions() const
virtual QFixed descent() const
void setGlyphCache(const void *key, QFontEngineGlyphCache *data)
virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints)
virtual Properties properties() const
void loadKerningPairs(QFixed scalingFactor)
QFixed calculatedCapHeight() const
static const uchar * getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
virtual int glyphCount() const
virtual QImage bitmapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t, const QColor &color=QColor())
virtual Qt::HANDLE handle() const
virtual qreal minRightBearing() const
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily)
virtual bool expectsGammaCorrectedBlending() const
int m_subPixelPositionCount
virtual qreal minLeftBearing() const
bool m_heightMetricsQueried
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=nullptr, qreal *rightBearing=nullptr)
static bool isIgnorableChar(char32_t ucs4)
virtual Glyph * glyphData(glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t)
bool supportsScript(QChar::Script script) const
virtual qreal maxCharWidth() const =0
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
void * harfbuzzFont() const
virtual QFixed ascent() const
bool canRender(uint ucs4) const
virtual QImage alphaMapForGlyph(glyph_t)
QFixed firstLeftBearing(const QGlyphLayout &glyphs)
struct QFontEngine::FaceData faceData
virtual QImage alphaRGBMapForGlyph(glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t)
QByteArray getSfntTable(uint tag) const
virtual QFixed averageCharWidth() const
virtual void removeGlyphFromCache(glyph_t)
virtual void initializeHeightMetrics() const
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual bool supportsVerticalSubPixelPositions() const
static bool scriptRequiresOpenType(QChar::Script script)
bool processOS2Table() const
virtual void doKerning(QGlyphLayout *, ShaperFlags) const
bool processHheaTable() const
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
void clearGlyphCache(const void *key)
virtual glyph_t glyphIndex(uint ucs4) const =0
virtual QFixed lineThickness() const
virtual QFixed underlinePosition() const
void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const
Returns true if the font table idetified by tag exists in the font; returns false otherwise.
virtual bool supportsTransformation(const QTransform &transform) const
bool supportsSubPixelPositions() const
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint unicode)
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
QFixed lastRightBearing(const QGlyphLayout &glyphs)
virtual void recalcAdvances(QGlyphLayout *, ShaperFlags) const
QList< KernPair > kerning_pairs
QFontEngineGlyphCache * glyphCache(const void *key, GlyphFormat format, const QTransform &transform, const QColor &color=QColor()) const
virtual QFixed leading() const
void * harfbuzzFace() const
virtual bool hasUnreliableGlyphOutline() const
virtual QFixed xHeight() const
virtual QFixed emSquareSize() const
virtual QFixedPoint subPixelPositionFor(const QFixedPoint &position) const
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Style
This enum describes the different styles of glyphs that are used to display text.
static QGuiApplicationPrivate * instance()
bool remove(const Key &key)
Removes the item that has the key from the hash.
const_iterator constFind(const Key &key) const noexcept
const_iterator cend() const noexcept
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
int width() const
Returns the width of the image.
uchar * bits()
Returns a pointer to the first pixel data.
int height() const
Returns the height of the image.
@ Format_ARGB32_Premultiplied
void fill(uint pixel)
Fills the entire image with the given pixelValue.
const uchar * constScanLine(int) const
Returns a pointer to the pixel data at the scanline with index i.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void resize(qsizetype size)
The QPainter class performs low-level painting on widgets and other paint devices.
const QPen & pen() const
Returns the painter's current pen.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void restore()
Restores the current painter state (pops a saved state off the stack).
void save()
Saves the current painter state (pushes the state onto a stack).
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
iterator find(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QTestFontEngine(int size)
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
AudioChannelLayoutTag tag
static const QCssKnownValue positions[NumKnownPositionModes - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void * user_data
static QString header(const QString &name)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
int qRound(qfloat16 d) noexcept
QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
static bool qt_get_font_table_default(void *user_data, uint tag, uchar *buffer, uint *length)
static bool qSafeFromBigEndian(const uchar *source, const uchar *end, T *output)
static QT_BEGIN_NAMESPACE bool qtransform_equals_no_translate(const QTransform &a, const QTransform &b)
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
static void collectSingleContour(qreal x0, qreal y0, uint *grid, int x, int y, int w, int h, QPainterPath *path)
QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
static glyph_t stripped(glyph_t glyph)
Q_GUI_EXPORT void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
#define kBearingNotInitialized
#define kMinLeftSideBearingOffset
#define q16Dot16ToFloat(i)
#define kMinRightSideBearingOffset
void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
hb_script_t hb_qt_script_to_script(QChar::Script script)
hb_font_t * hb_qt_font_get_for_engine(QFontEngine *fe)
hb_face_t * hb_qt_face_get_for_engine(QFontEngine *fe)
struct hb_face_t hb_face_t
static ControlElement< T > * ptr(QWidget *widget)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum const void GLbitfield GLsizei numGlyphs
GLsizei GLenum const void GLuint GLsizei GLfloat * metrics
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLuint GLfloat GLfloat y0
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * table
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
constexpr QRgb qRgb(int r, int g, int b)
constexpr int qAlpha(QRgb rgb)
#define Q_AUTOTEST_EXPORT
QT_BEGIN_NAMESPACE typedef uchar * output
QNetworkRequest request(url)
static constexpr QFixed fromReal(qreal r)
static constexpr QFixed fromFixed(int fixed)
constexpr QFixed round() const
constexpr QFixed ceil() const
constexpr qreal toReal() const
QByteArray postscriptName
The QFont::Tag type provides access to advanced font features.
QGlyphJustification * justifications
QFixed effectiveAdvance(int item) const
void copy(QGlyphLayout *other)
QGlyphAttributes * attributes
QGlyphLayout mid(int position, int n=-1) const
QFixed rightBearing() const
QFixed leftBearing() const
QThreadStorage< QCache< QString, SomeClass > > caches
[7]