43 #include <private/qfontengine_p.h> 51 #include <private/qharfbuzz_p.h> 74 static HB_Bool
hb_stringToGlyphs(HB_Font font,
const HB_UChar16 *
string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft)
84 int nGlyphs = *numGlyphs;
85 bool result = fe->
stringToCMap(reinterpret_cast<const QChar *>(
string), length, &qglyphs, &nGlyphs, shaperFlags);
90 for (hb_uint32 i = 0; i < *numGlyphs; ++i)
91 glyphs[i] = qglyphs.glyphs[i];
96 static void hb_getAdvances(HB_Font font,
const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances,
int flags)
102 for (hb_uint32 i = 0; i < numGlyphs; ++i)
103 qglyphs.
glyphs[i] = glyphs[i];
107 for (hb_uint32 i = 0; i < numGlyphs; ++i)
108 advances[i] = qglyphs.advances_x[i].value();
111 static HB_Bool
hb_canRender(HB_Font font,
const HB_UChar16 *
string, hb_uint32 length)
114 return fe->
canRender(reinterpret_cast<const QChar *>(
string), length);
122 metrics->y = m.y.value();
123 metrics->width = m.width.value();
124 metrics->height = m.height.value();
125 metrics->xOffset = m.xoff.value();
126 metrics->yOffset = m.yoff.value();
152 return HB_Err_Not_Covered;
155 static HB_Error
hb_getPointInOutline(HB_Font font, HB_Glyph glyph,
int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
166 static HB_Error
hb_getSFntTable(
void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
170 return HB_Err_Invalid_Argument;
201 int lw = score / 700;
204 if (lw < 2 && score >= 1050) lw = 2;
275 const bool transform = matrix.
m11() != 1.
276 || matrix.
m12() != 0.
277 || matrix.
m21() != 0.
278 || matrix.
m22() != 1.;
287 int totalKashidas = 0;
311 gpos = gpos * matrix;
315 positions[current].x = gpos_x;
316 positions[current].y = gpos_y;
317 glyphs_out[current] = glyphs.
glyphs[i];
332 gpos = gpos * matrix;
336 positions[current].x = gpos_x;
337 positions[current].y = gpos_y;
338 glyphs_out[current] = g.
glyphs[0];
353 positions[current].x = xpos + glyphs.
offsets[i].
x;
354 positions[current].y = ypos + glyphs.
offsets[i].
y;
355 glyphs_out[current] = glyphs.
glyphs[i];
368 gpos = gpos * matrix;
371 glyphs_out[current] = glyphs.
glyphs[i];
380 positions.
resize(current);
381 glyphs_out.
resize(current);
389 if (leftBearing != 0)
391 if (rightBearing != 0)
401 for (
int i = 0; i < glyphs.
numGlyphs; i++) {
405 overall.
x =
qMin(overall.
x, x);
406 overall.
y =
qMin(overall.
y, y);
413 overall.
width = xmax - overall.
x;
420 QTextItem::RenderFlags flags)
432 #define GRID(x, y) grid[(y)*(w+1) + (x)] 433 #define SET(x, y) (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7))) 445 path->
moveTo(x + x0, y + y0);
448 while (
GRID(x, y) & EdgeRight) {
449 GRID(x, y) &= ~EdgeRight;
453 path->
lineTo(x + x0, y + y0);
457 while (
GRID(x, y) & EdgeDown) {
458 GRID(x, y) &= ~EdgeDown;
462 path->
lineTo(x + x0, y + y0);
466 while (
GRID(x, y) & EdgeLeft) {
467 GRID(x, y) &= ~EdgeLeft;
471 path->
lineTo(x + x0, y + y0);
475 while (
GRID(x, y) & EdgeUp) {
476 GRID(x, y) &= ~EdgeUp;
480 path->
lineTo(x + x0, y + y0);
491 for (
int y = 0; y <= h; ++y) {
492 for (
int x = 0; x <= w; ++x) {
493 bool topLeft = (x == 0)|(y == 0) ? false :
SET(x - 1, y - 1);
494 bool topRight = (x == w)|(y == 0) ? false :
SET(x, y - 1);
495 bool bottomLeft = (x == 0)|(y == h) ? false :
SET(x - 1, y);
496 bool bottomRight = (x == w)|(y == h) ? false :
SET(x, y);
499 if ((!topRight) & bottomRight)
501 if ((!bottomRight) & bottomLeft)
503 if ((!bottomLeft) & topLeft)
505 if ((!topLeft) & topRight)
511 for (
int y = 0; y < h; ++y) {
512 for (
int x = 0; x < w; ++x) {
533 for (
int i=0; i < glyphs.
numGlyphs; ++i) {
542 const int w = alphaMask.
width();
543 const int h = alphaMask.
height();
546 if (alphaMask.
depth() == 1) {
550 const uchar *imageData = alphaMask.
bits();
554 for (
int yi = 0; yi < h; ++yi) {
555 const uchar *src = imageData + yi*srcBpl;
556 uchar *dst = bitmapData + yi*destBpl;
557 for (
int xi = 0; xi < w; ++xi) {
558 const int byte = xi / 8;
559 const int bit = xi % 8;
563 dst[byte] |= 128 >> bit;
567 const uchar *bitmap_data = bitmap.
bits();
569 advanceX += offset.
x;
570 advanceY += offset.
y;
584 for (
int i = 0; i < nGlyphs; ++i) {
586 if (i < nGlyphs - 1) {
633 for (
int y=0; y<alphaMask.
height(); ++y) {
634 uint *dst = (
uint *) rgbMask.scanLine(y);
636 for (
int x=0; x<alphaMask.
width(); ++x) {
637 int val =
qAlpha(colorTable.at(src[x]));
638 dst[x] =
qRgb(val, val, val);
650 int glyph_width =
qCeil((gm.
x + gm.
width).toReal()) - glyph_x;
651 int glyph_height =
qCeil((gm.
y + gm.
height).toReal()) - glyph_y;
653 if (glyph_width <= 0 || glyph_height <= 0)
671 for (
int i=0; i<256; ++i)
672 colors[i] =
qRgba(0, 0, 0, i);
673 indexed.setColorTable(colors);
675 for (
int y=0; y<im.
height(); ++y) {
678 for (
int x=0; x<im.
width(); ++x)
756 if (key ==
it->context
765 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_SYMBIAN) 768 uint left_right = (left << 16) + right;
770 left = 0, right = numPairs - 1;
771 while (left <= right) {
772 int middle = left + ( ( right -
left ) >> 1 );
774 if(pairs[middle].left_right == left_right)
775 return pairs[middle].
adjust;
777 if (pairs[middle].left_right < left_right)
794 for(
int i = 0; i < glyphs->
numGlyphs - 1; ++i)
797 for(
int i = 0; i < glyphs->
numGlyphs - 1; ++i)
821 for(
int i = 0; i < numTables; ++i) {
822 if (offset + 6 > tab.
size()) {
826 const uchar *header = table + offset;
832 if(version == 0 && coverage == 0x0001) {
833 if (offset + length > tab.
size()) {
840 if(nPairs * 6 + 8 > length - 6) {
847 for(
int i = 0; i < nPairs; ++i) {
873 if (maxpTable.
size() < 6)
880 const uchar *header = table;
884 const uchar *endPtr = table + tableSize;
891 const uchar *maps = table + 4;
892 if (maps + 8 * numTables > endPtr)
902 MicrosoftUnicodeExtended
905 int symbolTable = -1;
908 for (
int n = 0; n < numTables; ++n) {
911 switch (platformId) {
913 if (score < Unicode &&
914 (platformSpecificId == 0 ||
915 platformSpecificId == 2 ||
916 platformSpecificId == 3)) {
919 }
else if (score < Unicode11 && platformSpecificId == 1) {
925 if (score < AppleRoman && platformSpecificId == 0) {
931 switch (platformSpecificId) {
934 if (score < Symbol) {
940 if (score < MicrosoftUnicode) {
942 score = MicrosoftUnicode;
946 if (score < MicrosoftUnicodeExtended) {
948 score = MicrosoftUnicodeExtended;
962 *isSymbolFont = (symbolTable > -1);
966 if (!unicode_table || unicode_table + 8 > tableSize)
970 header = table + unicode_table;
979 if (table + unicode_table + length > endPtr)
986 if (symbolTable > -1 && ((score == Unicode) || (score == Unicode11))) {
987 const uchar *selectedTable = table + unicode_table;
990 bool unicodeTableHasLatin1 =
false;
991 for (
int uc=0x00; uc<0x100; ++uc) {
993 unicodeTableHasLatin1 =
true;
999 bool unicodeTableHasSymbols =
false;
1000 if (!unicodeTableHasLatin1) {
1001 for (
int uc=0xf000; uc<0xf100; ++uc) {
1003 unicodeTableHasSymbols =
true;
1010 if (!unicodeTableHasLatin1 && unicodeTableHasSymbols) {
1011 tableToUse = symbolTable;
1017 return table + unicode_table;
1025 return (
int) *(cmap+6+unicode);
1026 }
else if (format == 4) {
1032 if(unicode >= 0xffff)
1035 const unsigned char *ends = cmap + 14;
1039 const unsigned char *idx = ends + segCountX2 + 2 + 2*i;
1042 if (startIndex > unicode)
1051 if (idRangeoffset_t) {
1054 glyphIndex = (idDelta + id) % 0x10000;
1058 glyphIndex = (idDelta + unicode) % 0x10000;
1061 }
else if (format == 6) {
1065 if (unicode < firstCode6)
1069 if (entryCount6 * 2 + 10 > tableSize)
1072 quint16 sentinel6 = firstCode6 + entryCount6;
1073 if (unicode >= sentinel6)
1076 quint16 entryIndex6 = unicode - firstCode6;
1078 }
else if (format == 12) {
1084 while (left <=
right) {
1085 int middle = left + ( (
right -
left ) >> 1 );
1088 if(unicode < startCharCode)
1092 if(unicode <= endCharCode)
1098 qDebug(
"cmap table of format %d not implemented", format);
1124 for (
int i = 0; i < x->size(); ++i, ++
it)
1125 *it = 0xff000000 | i | (i<<8) | (i<<16);
1130 return *qt_grayPalette();
1161 if (*nglyphs < len) {
1166 for (
int i = 0; i < len; i++) {
1179 for (
int i = 0; i < glyphs->
numGlyphs; i++) {
1196 for (
int k = 0; k < positions.
size(); k++)
1209 #if defined(Q_WS_QWS) || defined(Q_WS_QPA) 1222 if (glyphs.
size() == 0)
1232 for (
int k = 0; k < positions.
size(); k++)
1292 for (
int i=0; i<256; ++i)
1293 colors[i] =
qRgba(0, 0, 0, i);
1298 for (
int i=2; i <=
_size-3; ++i) {
1312 {
return glyph >> 24; }
1316 {
return glyph & 0x00ffffff; }
1326 for (
int i = 0; i <
engines.size(); ++i) {
1338 QTextEngine::ShaperFlags flags)
const 1341 if (!engine(0)->
stringToCMap(str, len, glyphs, &ng, flags))
1345 for (
int i = 0; i < len; ++i) {
1350 for (
int x = 1; x <
engines.size(); ++x) {
1363 engine->
stringToCMap(str + i, surrogate ? 2 : 1, &offs, &num, flags);
1365 if (glyphs->
glyphs[glyph_pos]) {
1367 glyphs->
glyphs[glyph_pos] |= (x << 24);
1372 if (!glyphs->
glyphs[glyph_pos]) {
1402 for (i = start; i <
end; ++i)
1406 const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.
mid(start, end - start));
1408 overall.
x =
qMin(overall.
x, gm.
x);
1409 overall.
y =
qMin(overall.
y, gm.
y);
1417 const int hi = which << 24;
1418 for (i = start; i <
end; ++i)
1427 for (i = start; i <
end; ++i)
1431 const glyph_metrics_t gm = engine(which)->boundingBox(glyphs.
mid(start, end - start));
1433 overall.
x =
qMin(overall.
x, gm.
x);
1434 overall.
y =
qMin(overall.
y, gm.
y);
1442 const int hi = which << 24;
1443 for (i = start; i <
end; ++i)
1452 engine(which)->getGlyphBearings(
stripped(glyph), leftBearing, rightBearing);
1465 for (
int gl = 0; gl < glyphs.
numGlyphs; gl++) {
1475 if (flags & QTextItem::RightToLeft) {
1476 for (i = start; i <
end; ++i) {
1483 for (i = start; i <
end; ++i)
1485 engine(which)->addOutlineToPath(x, y, glyphs.
mid(start, end - start), path, flags);
1487 const int hi = which << 24;
1488 for (i = start; i <
end; ++i)
1491 if (!(flags & QTextItem::RightToLeft)) {
1492 for (i = start; i <
end; ++i) {
1503 if (flags & QTextItem::RightToLeft) {
1504 for (i = start; i <
end; ++i) {
1511 for (i = start; i <
end; ++i)
1514 engine(which)->addOutlineToPath(x, y, glyphs.
mid(start, end - start), path, flags);
1517 const int hi = which << 24;
1518 for (i = start; i <
end; ++i)
1536 for (i = start; i <
end; ++i)
1540 engine(which)->recalcAdvances(&offs, flags);
1543 const int hi = which << 24;
1544 for (i = start; i <
end; ++i)
1553 for (i = start; i <
end; ++i)
1557 engine(which)->recalcAdvances(&offs, flags);
1560 const int hi = which << 24;
1561 for (i = start; i <
end; ++i)
1579 for (i = start; i <
end; ++i)
1583 engine(which)->doKerning(&offs, flags);
1586 const int hi = which << 24;
1587 for (i = start; i <
end; ++i)
1596 for (i = start; i <
end; ++i)
1600 engine(which)->doKerning(&offs, flags);
1603 const int hi = which << 24;
1604 for (i = start; i <
end; ++i)
1612 return engine(which)->boundingBox(
stripped(glyph));
1616 {
return engine(0)->ascent(); }
1619 {
return engine(0)->descent(); }
1623 return engine(0)->leading();
1628 return engine(0)->xHeight();
1633 return engine(0)->averageCharWidth();
1638 return engine(0)->lineThickness();
1643 return engine(0)->underlinePosition();
1648 return engine(0)->maxCharWidth();
1653 return engine(0)->minLeftBearing();
1658 return engine(0)->minRightBearing();
1673 bool allExist =
true;
1674 for (
int i = 0; i < nglyphs; i++) {
The QPainter class performs low-level painting on widgets and other paint devices.
virtual QFixed lineThickness() const
glyph_metrics_t tightBoundingBox(const QGlyphLayout &glyphs)
virtual QFixed averageCharWidth() const
QGlyphJustification * justifications
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
virtual qreal minRightBearing() const
static QFixed fromFixed(int fixed)
void qHBFreeFace(HB_Face face)
virtual QFixed lineThickness() const
virtual int glyphCount() const
virtual QImage alphaMapForGlyph(glyph_t)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
virtual Type type() const
char * data()
Returns a pointer to the data stored in the byte array.
void setColorTable(const QVector< QRgb > colors)
Sets the color table used to translate color indexes to QRgb values, to the specified colors...
#define it(className, varName)
The QFlag class is a helper data type for QFlags.
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
static HB_Error hb_getPointInOutline(HB_Font font, HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const
static void hb_getAdvances(HB_Font font, const HB_Glyph *glyphs, hb_uint32 numGlyphs, HB_Fixed *advances, int flags)
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
static glyph_t stripped(glyph_t glyph)
virtual QFixed averageCharWidth() const
void fill(uint pixel)
Fills the entire image with the given pixelValue.
The QByteArray class provides an array of bytes.
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
QObjectUserData * userData(uint id) const
The QPointF class defines a point in the plane using floating point precision.
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
void restore()
Restores the current painter state (pops a saved state off the stack).
static const uchar * getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
bool isLowSurrogate() const
Returns true if the QChar is the low part of a utf16 surrogate (ie.
virtual QImage alphaMapForGlyph(glyph_t)
QLinkedList< GlyphCacheEntry > m_glyphCaches
virtual QFixed ascent() const
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
int bytesPerLine() const
Returns the number of bytes per image scanline.
long ASN1_INTEGER_get ASN1_INTEGER * a
Q_GUI_EXPORT void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
quint32 qFromBigEndian< quint32 >(const uchar *src)
QGlyphLayout mid(int position, int n=-1) const
static QFixed fromReal(qreal r)
virtual const char * name() const
bool isHighSurrogate() const
Returns true if the QChar is the high part of a utf16 surrogate (ie.
The QObject class is the base class of all Qt objects.
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const =0
virtual bool canRender(const QChar *string, int len)
The QPen class defines how a QPainter should draw lines and outlines of shapes.
virtual Type type() const =0
The QChar class provides a 16-bit Unicode character.
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
void save()
Saves the current painter state (pushes the state onto a stack).
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Category category() const
Returns the character's category.
void resize(int size)
Sets the size of the vector to size.
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
#define MAKE_TAG(ch1, ch2, ch3, ch4)
virtual qreal maxCharWidth() const =0
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
Q_CORE_EXPORT void qDebug(const char *,...)
static void hb_getGlyphMetrics(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round=false)
QPainter * painter() const
Returns the paint engine's painter.
const QPen & pen() const
Returns the painter's current pen.
#define QT_BEGIN_NAMESPACE
This macro expands to.
glyph_metrics_t transformed(const QTransform &xform) const
static HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
The QRectF class defines a rectangle in the plane using floating point precision. ...
The QLinkedList::const_iterator class provides an STL-style const iterator for QLinkedList.
static QList< QAxEngineDescriptor > engines
static bool qtransform_equals_no_translate(const QTransform &a, const QTransform &b)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
static HB_Fixed hb_getFontMetric(HB_Font font, HB_FontMetric metric)
virtual bool canRender(const QChar *string, int len)=0
QExplicitlySharedDataPointer< QFontEngineGlyphCache > cache
virtual qreal maxCharWidth() const
bool deref()
Atomically decrements the value of this QAtomicInt.
static QFontEngine * loadEngine(int script, const QFontDef &request, QtFontFamily *family, QtFontFoundry *foundry, QtFontStyle *style, QtFontSize *size)
virtual QFixed ascent() const =0
virtual QFixed descent() const =0
virtual qreal maxCharWidth() const
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
static const HB_FontClass hb_fontClass
int depth() const
Returns the depth of the image.
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)=0
QGlyphLayoutInstance instance(int position) const
virtual bool getSfntTableData(uint, uchar *, uint *) const
QImage transformed(const QMatrix &matrix, Qt::TransformationMode mode=Qt::FastTransformation) const
Returns a copy of the image that is transformed using the given transformation matrix and transformat...
virtual void removeGlyphFromCache(glyph_t)
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
virtual bool canRender(const QChar *string, int len)
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
void qSort(RandomAccessIterator start, RandomAccessIterator end)
virtual QFixed xHeight() const
static void collectSingleContour(qreal x0, qreal y0, uint *grid, int x, int y, int w, int h, QPainterPath *path)
HB_Font harfbuzzFont() const
quint16 qFromBigEndian< quint16 >(const uchar *src)
QByteArray postscriptName
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
virtual QFixed leading() const
void resize(int totalGlyphs)
const char * constData() const
Returns a pointer to the data stored in the byte array.
uchar * bits()
Returns a pointer to the first pixel data.
void setPixel(int x, int y, uint index_or_rgb)
Sets the pixel index or color at (x, y) to index_or_rgb.
virtual qreal minLeftBearing() const
HB_Face qHBNewFace(void *font, HB_GetFontTableFunc tableFunc)
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
virtual QFixed ascent() const
virtual Properties properties() const
void setGlyphCache(void *key, QFontEngineGlyphCache *data)
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
Q_GUI_EXPORT_INLINE QRgb qRgb(int r, int g, int b)
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily)
virtual QFixed descent() const
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void resize(int size)
Sets the size of the byte array to size bytes.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
if(void) toggleToolbarShown
virtual QFixed emSquareSize() const
int height() const
Returns the height of the image.
int size() const
Returns the number of bytes in this byte array.
virtual QFixed descent() const
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
QVector< KernPair > kerning_pairs
static const QVector< QRgb > & grayPalette()
HB_GlyphAttributes * attributes
QByteArray & replace(int index, int len, const char *s)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
static HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft)
void loadKerningPairs(QFixed scalingFactor)
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
QFontEngineGlyphCache * glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
static uchar highByte(glyph_t glyph)
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
QFontEngineMulti(int engineCount)
virtual QFixed underlinePosition() const
virtual QImage alphaMapForGlyph(glyph_t)
static const KeyPair *const end
void setInstance(int position, const QGlyphLayoutInstance &g)
virtual QFixed xHeight() const
virtual QFixed leading() const
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
virtual HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
QVector< QRgb > colorTable() const
Returns a list of the colors contained in the image's color table, or an empty list if the image does...
Q_GLOBAL_STATIC_WITH_INITIALIZER(QVector< QRgb >, qt_grayPalette, { x->resize(256);QRgb *it=x->data();for(int i=0;i< x->size();++i,++it) *it=0xff000000|i|(i<< 8)|(i<< 16);}) const QVector< QRgb > &QFontEngine
Q_DECL_CONSTEXPR int qRound(qreal d)
virtual QFixed underlinePosition() const
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
virtual QFixed leading() const =0
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
static HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
static qreal toReal(Register *reg, int type, bool *ok=0)
virtual bool supportsSubPixelPositions() const
HB_Face harfbuzzFace() const
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
QByteArray getSfntTable(uint) const