44 #include <private/qapplication_p.h> 45 #include <private/qfontengine_p.h> 46 #include <private/qpainter_p.h> 47 #include <private/qtextengine_p.h> 49 #include <private/qpaintengine_mac_p.h> 50 #include <private/qprintengine_mac_p.h> 58 #include <private/qimage_p.h> 60 #include <ApplicationServices/ApplicationServices.h> 61 #include <AppKit/AppKit.h> 73 #define FixedToQFixed(a) QFixed::fromFixed((a) >> 10) 74 #define QFixedToFixed(x) ((x).value() << 10) 83 inline void setPosition(
float _x,
float _y) { x = _x; y = _y; }
84 inline void advance(
float _x) { x += _x; }
87 const Float32Point *,
void *);
101 const Float32Point *ep,
void *
data)
106 p->
x + cp2->x, p->
y + cp2->y,
107 p->
x + ep->x, p->
y + ep->y);
125 #ifndef QT_MAC_USE_COCOA 134 FMFontFamily fmFamily;
135 FMFontStyle fntStyle = 0;
136 fmFamily = FMGetFontFamilyFromATSFontFamilyRef(atsFamily);
137 if (fmFamily == kInvalidFontFamily) {
139 fontID = FMGetFontFromATSFontRef(atsFontRef);
144 fntStyle |= ::italic;
146 FMFontStyle intrinsicStyle;
148 if (FMGetFontFromFontFamilyInstance(fmFamily, fntStyle, &fnt, &intrinsicStyle) == noErr)
149 fontID = FMGetATSFontRefFromFont(fnt);
158 const int maxAttributeCount = 5;
159 ATSUAttributeTag tags[maxAttributeCount + 1];
160 ByteCount sizes[maxAttributeCount + 1];
161 ATSUAttributeValuePtr
values[maxAttributeCount + 1];
162 int attributeCount = 0;
164 Fixed size = FixRatio(fontDef.
pixelSize, 1);
165 tags[attributeCount] = kATSUSizeTag;
166 sizes[attributeCount] =
sizeof(size);
167 values[attributeCount] = &size;
170 tags[attributeCount] = kATSUFontTag;
171 sizes[attributeCount] =
sizeof(
fontID);
172 values[attributeCount] = &this->
fontID;
177 transform = CGAffineTransformMakeScale(
float(fontDef.
stretch) /
float(100), 1);
178 tags[attributeCount] = kATSUFontMatrixTag;
179 sizes[attributeCount] =
sizeof(
transform);
184 status = ATSUCreateStyle(&
style);
187 Q_ASSERT(attributeCount < maxAttributeCount + 1);
188 status = ATSUSetAttributes(
style, attributeCount, tags, sizes, values);
199 ATSUDisposeStyle(
style);
222 void *operationExtraParameter, ATSULayoutOperationCallbackStatus *callbackStatus)
230 ATSLayoutRecord *layoutData = 0;
231 ItemCount itemCount = 0;
234 e = ATSUDirectGetLayoutDataArrayPtrFromLineRef(lineRef, kATSUDirectDataLayoutRecordATSLayoutRecordCurrent,
236 (
void **) &layoutData,
243 Fixed *baselineDeltas = 0;
245 e = ATSUDirectGetLayoutDataArrayPtrFromLineRef(lineRef, kATSUDirectDataBaselineDeltaFixedArray,
247 (
void **) &baselineDeltas,
252 int nextCharStop = -1;
253 int currentClusterGlyph = -1;
257 #if !defined(QT_NO_DEBUG) 260 for (
int i = item->
from; i < item->from + item->
length - 1; ++i)
263 for (nextCharStop = item->
from; nextCharStop < item->from + item->
length; ++nextCharStop)
266 nextCharStop -= item->
from;
271 int glyphIncrement = 1;
273 glyphIdx = itemCount - 2;
276 for (
int i = 0; i < *nfo->
numGlyphs; ++i, glyphIdx += glyphIncrement) {
278 int charOffset = layoutData[glyphIdx].originalOffset /
sizeof(UniChar);
281 ATSGlyphRef glyphId = layoutData[glyphIdx].glyphID;
284 QFixed xAdvance =
FixedToQFixed(layoutData[glyphIdx + 1].realPos - layoutData[glyphIdx].realPos);
287 yAdvance = yAdvance.
round();
288 xAdvance = xAdvance.
round();
291 if (glyphId != 0xffff || i == 0) {
292 if (i < nfo->glyphs->numGlyphs)
294 nfo->
glyphs->
glyphs[i] = (glyphId & 0x00ffffff) | (fontIdx << 24);
311 if (charOffset >= nextCharStop) {
313 currentClusterGlyph = i;
316 for (; nextCharStop < item->
length; ++nextCharStop)
320 if (currentClusterGlyph == -1)
321 currentClusterGlyph = i;
326 if (charOffset < item->length - 1) {
330 item->
log_clusters[charOffset + 1] = currentClusterGlyph;
346 ATSUDirectReleaseLayoutDataArrayPtr(lineRef, kATSUDirectDataBaselineDeltaFixedArray,
347 (
void **) &baselineDeltas);
349 ATSUDirectReleaseLayoutDataArrayPtr(lineRef, kATSUDirectDataLayoutRecordATSLayoutRecordCurrent,
350 (
void **) &layoutData);
352 *callbackStatus = kATSULayoutOperationCallbackStatusHandled;
372 return stringToCMap(str, len, glyphs, nglyphs, flags, 0, 0, 0);
376 unsigned short *logClusters,
const HB_CharAttributes *charAttributes,
QScriptItem *)
const 378 if (*nglyphs < len) {
387 shaperItem.
glyphs = *glyphs;
389 shaperItem.
flags = flags;
393 const int maxChars =
qMax(1,
397 if (len < maxChars || !charAttributes)
405 tmpItem.
from = shaperItem.
from + charIdx;
407 int charCount =
qMin(maxChars, len - charIdx);
409 int lastWhitespace = tmpItem.
from + charCount - 1;
410 int lastSoftBreak = lastWhitespace;
411 int lastCharStop = lastSoftBreak;
412 for (
int i = lastCharStop; i >= tmpItem.
from; --i) {
422 charCount =
qMin(lastWhitespace,
qMin(lastSoftBreak, lastCharStop)) - tmpItem.
from + 1;
427 tmpItem.
length = charCount;
431 &tmpItem.
glyphs, &glyphCount, flags,
436 for (
int i = 0; i < charCount; ++i)
438 glyphIdx += glyphCount;
439 charIdx += charCount;
440 }
while (charIdx < len);
453 e = ATSUSetTextPointerLocation(
textLayout, (UniChar *)(str), 0, len, len);
455 qWarning(
"Qt: internal: %ld: Error ATSUSetTextPointerLocation %s: %d",
long(e), __FILE__, __LINE__);
467 int prevNumGlyphs = *nglyphs;
470 for (
int i = 0; i < len; ++i)
474 Q_ASSERT(
sizeof(
void *) <=
sizeof(URefCon));
475 e = ATSUSetTextLayoutRefCon(
textLayout, (URefCon)&nfo);
477 qWarning(
"Qt: internal: %ld: Error ATSUSetTextLayoutRefCon %s: %d",
long(e), __FILE__, __LINE__);
482 const int maxAttributeCount = 3;
483 ATSUAttributeTag tags[maxAttributeCount + 1];
484 ByteCount sizes[maxAttributeCount + 1];
485 ATSUAttributeValuePtr
values[maxAttributeCount + 1];
486 int attributeCount = 0;
488 tags[attributeCount] = kATSULineLayoutOptionsTag;
489 ATSLineLayoutOptions layopts = kATSLineHasNoOpticalAlignment
490 | kATSLineIgnoreFontLeading
491 | kATSLineNoSpecialJustification
492 | kATSLineDisableAllJustification
496 layopts |= kATSLineNoAntiAliasing;
499 layopts |= kATSLineDisableAllKerningAdjustments;
501 values[attributeCount] = &layopts;
502 sizes[attributeCount] =
sizeof(layopts);
505 tags[attributeCount] = kATSULayoutOperationOverrideTag;
506 ATSULayoutOperationOverrideSpecifier spec;
507 spec.operationSelector = kATSULayoutOperationPostLayoutAdjustment;
509 values[attributeCount] = &spec;
510 sizes[attributeCount] =
sizeof(spec);
516 direction = kATSURightToLeftBaseDirection;
518 direction = kATSULeftToRightBaseDirection;
519 tags[attributeCount] = kATSULineDirectionTag;
521 sizes[attributeCount] =
sizeof(
direction);
524 Q_ASSERT(attributeCount < maxAttributeCount + 1);
525 e = ATSUSetLayoutControls(
textLayout, attributeCount, tags, sizes, values);
527 qWarning(
"Qt: internal: %ld: Error ATSUSetLayoutControls %s: %d",
long(e), __FILE__, __LINE__);
535 qWarning(
"Qt: internal: %ld: Error ATSUSetRunStyle %s: %d",
long(e), __FILE__, __LINE__);
542 ATSUFontID substFont = 0;
543 UniCharArrayOffset changedOffset = 0;
544 UniCharCount changeCount = 0;
546 e = ATSUMatchFontsToText(
textLayout, pos, len - pos,
547 &substFont, &changedOffset,
549 if (e == kATSUFontsMatched) {
551 for (
uint i = 0; i < changeCount; ++i)
552 mappedFonts[changedOffset + i] = fontIdx;
553 pos = changedOffset + changeCount;
555 }
else if (e == kATSUFontsNotMatched) {
556 pos = changedOffset + changeCount;
558 }
while (pos < len && e != noErr);
563 e = ATSUMeasureTextImage(
textLayout, kATSUFromTextBeginning, kATSUToTextEnd,
567 qWarning(
"Qt: internal: %ld: Error ATSUMeasureTextImage %s: %d",
long(e), __FILE__, __LINE__);
572 if (!nfo.callbackCalled) {
573 qWarning(
"Qt: internal: %ld: Error ATSUMeasureTextImage did not trigger callback %s: %d",
long(e), __FILE__, __LINE__);
577 ATSUClearLayoutCache(
textLayout, kATSUFromTextBeginning);
578 if (prevNumGlyphs < *nfo.numGlyphs)
603 ATSUSetTextPointerLocation(
textLayout, reinterpret_cast<const UniChar *>(
string), 0, len, len);
609 FMFont substFont = 0;
610 UniCharArrayOffset changedOffset = 0;
611 UniCharCount changeCount = 0;
614 e = ATSUMatchFontsToText(
textLayout, pos, len - pos,
615 &substFont, &changedOffset,
617 if (e == kATSUFontsMatched) {
618 pos = changedOffset + changeCount;
619 }
else if (e == kATSUFontsNotMatched) {
622 }
while (pos < len && e != noErr);
624 return e == noErr || e == kATSUFontsMatched;
628 : fontID(fontID), multiEngine(multiEngine),
cmap(0), symbolCMap(false)
631 ATSUCreateAndCopyStyle(baseStyle, &
style);
632 ATSFontRef atsFont = FMGetATSFontRefFromFont(fontID);
633 cgFont = CGFontCreateWithPlatformFont(&atsFont);
635 const int maxAttributeCount = 4;
636 ATSUAttributeTag tags[maxAttributeCount + 1];
637 ByteCount sizes[maxAttributeCount + 1];
638 ATSUAttributeValuePtr
values[maxAttributeCount + 1];
639 int attributeCount = 0;
648 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'h',
'e',
'a',
'd'), 44, 4, &data, &len) == noErr)
655 if (!(macStyle & 1)) {
658 tags[attributeCount] = kATSUQDBoldfaceTag;
659 sizes[attributeCount] =
sizeof(atsuBold);
660 values[attributeCount] = &atsuBold;
665 if (!(macStyle & 2)) {
668 tags[attributeCount] = kATSUQDItalicTag;
669 sizes[attributeCount] =
sizeof(atsuItalic);
670 values[attributeCount] = &atsuItalic;
675 tags[attributeCount] = kATSUFontTag;
676 values[attributeCount] = &
fontID;
677 sizes[attributeCount] =
sizeof(
fontID);
680 Q_ASSERT(attributeCount < maxAttributeCount + 1);
681 OSStatus err = ATSUSetAttributes(
style, attributeCount, tags, sizes, values);
687 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'O',
'S',
'/',
'2'), 8, 2, &tmpFsType, 0) == noErr)
697 ATSUTextMeasurement metric;
699 ATSUGetAttribute(
style, kATSUAscentTag,
sizeof(metric), &metric, 0);
702 ATSUGetAttribute(
style, kATSUDescentTag,
sizeof(metric), &metric, 0);
705 ATSUGetAttribute(
style, kATSULeadingTag,
sizeof(metric), &metric, 0);
708 ATSFontMetrics metrics;
710 ATSFontGetHorizontalMetrics(FMGetATSFontRefFromFont(fontID), kATSOptionFlagsDefault, &metrics);
713 ATSFontGetHorizontalMetrics(FMGetATSFontRefFromFont(fontID), kATSOptionFlagsDefault, &metrics);
716 ATSFontGetHorizontalMetrics(FMGetATSFontRefFromFont(fontID), kATSOptionFlagsDefault, &metrics);
732 ATSUDisposeStyle(
style);
735 static inline unsigned int getChar(
const QChar *str,
int &i,
const int len)
738 if (str[i].isHighSurrogate() && i < len-1 && str[i+1].isLowSurrogate()) {
756 for (
int i = 0; i < len; ++i) {
757 unsigned int uc =
getChar(str, i, len);
759 if(!glyphs->
glyphs[i] && uc < 0x100)
763 for (
int i = 0; i < len; ++i) {
764 unsigned int uc =
getChar(str, i, len);
783 for (
int i = 0; i < glyphs->
numGlyphs; ++i)
784 atsuGlyphs[i] = glyphs->
glyphs[i];
793 for (
int i = 0; i < glyphs->
numGlyphs; ++i) {
808 for (
int i = 0; i < glyphs.
numGlyphs; ++i) {
819 ATSGlyphScreenMetrics metrics;
821 ATSUGlyphGetScreenMetrics(
style, 1, &atsuGlyph, 0,
829 gm.
width = int(metrics.width);
830 gm.
height = int(metrics.height);
904 for (
int i = 0; i < numGlyphs; ++i) {
908 ATSUGlyphGetCubicPaths(style, glyph, moveTo, lineTo,
909 cubicTo, closePath, &fontpath, &e);
912 DisposeATSCubicMoveToUPP(moveTo);
913 DisposeATSCubicLineToUPP(lineTo);
914 DisposeATSCubicCurveToUPP(cubicTo);
915 DisposeATSCubicClosePathUPP(closePath);
919 QTextItem::RenderFlags)
936 uint cgflags = kCGImageAlphaNoneSkipFirst;
937 #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version 938 cgflags |= kCGBitmapByteOrder32Host;
946 CGContextSetShouldSmoothFonts(ctx, colorful);
947 CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx);
948 CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0);
949 CGAffineTransformConcat(cgMatrix, oldTextMatrix);
952 cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, tanf(14 * acosf(0) / 90), 1, 0, 0));
954 cgMatrix = CGAffineTransformConcat(cgMatrix,
transform);
956 CGContextSetTextMatrix(ctx, cgMatrix);
957 CGContextSetRGBFillColor(ctx, 1, 1, 1, 1);
958 CGContextSetTextDrawingMode(ctx, kCGTextFill);
959 CGContextSetFont(ctx,
cgFont);
963 CGContextSetTextPosition(ctx, pos_x, pos_y);
968 CGGlyph cgGlyph = glyph;
969 CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &advance, 1);
973 CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &advance, 1);
976 CGContextRelease(ctx);
987 for (
int i=0; i<256; ++i)
988 colors[i] =
qRgba(0, 0, 0, i);
989 indexed.setColorTable(colors);
991 for (
int y=0; y<im.
height(); ++y) {
993 uchar *dst = indexed.scanLine(y);
994 for (
int x=0; x<im.
width(); ++x) {
1033 if (glyphs.
size() == 0)
1038 CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx);
1040 CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, -1, 0, -paintDeviceHeight);
1042 CGAffineTransformConcat(cgMatrix, oldTextMatrix);
1045 cgMatrix = CGAffineTransformConcat(cgMatrix, CGAffineTransformMake(1, 0, -tanf(14 * acosf(0) / 90), 1, 0, 0));
1047 cgMatrix = CGAffineTransformConcat(cgMatrix,
transform);
1049 CGContextSetTextMatrix(ctx, cgMatrix);
1051 CGContextSetTextDrawingMode(ctx, kCGTextFill);
1057 for (
int i = 0; i < glyphs.
size() - 1; ++i) {
1058 advances[i].width = (positions[i + 1].x - positions[i].x).
toReal();
1059 advances[i].height = (positions[i + 1].y - positions[i].y).
toReal();
1060 cgGlyphs[i] = glyphs[i];
1062 advances[glyphs.
size() - 1].width = 0;
1063 advances[glyphs.
size() - 1].height = 0;
1064 cgGlyphs[glyphs.
size() - 1] = glyphs[glyphs.
size() - 1];
1066 CGContextSetFont(ctx,
cgFont);
1068 CGContextSetTextPosition(ctx, positions[0].x.toReal(), positions[0].y.toReal());
1070 CGContextShowGlyphsWithAdvances(ctx, cgGlyphs.data(), advances.data(), glyphs.
size());
1074 positions[0].y.toReal());
1076 CGContextShowGlyphsWithAdvances(ctx, cgGlyphs.data(), advances.data(), glyphs.
size());
1079 CGContextSetTextMatrix(ctx, oldTextMatrix);
1085 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) 1089 if (ATSFontGetFileReference(FMGetATSFontRefFromFont(
fontID), &ref) != noErr)
1098 if (ATSFontGetFileSpecification(FMGetATSFontRefFromFont(
fontID), &spec) != noErr)
1102 FSpMakeFSRef(&spec, &ref);
1112 ATSFontRef atsFont = FMGetATSFontRefFromFont(
fontID);
1115 OSStatus status = ATSFontGetTable(atsFont, tag, 0, 0, 0, &length);
1116 if (status != noErr)
1120 status = ATSFontGetTable(atsFont, tag, 0, table.
length(), table.
data(), &length);
1121 if (status != noErr)
1129 ATSFontRef atsFont = FMGetATSFontRefFromFont(
fontID);
1132 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'h',
'e',
'a',
'd'), 18, 2, &tmp, 0) == noErr)
1140 bbox.xMin = bbox.xMax = bbox.yMin = bbox.yMax = 0;
1142 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'h',
'e',
'a',
'd'), 36, 8, &bbox, 0) == noErr) {
1153 metrics.ascender = metrics.descender = metrics.linegap = 0;
1155 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'h',
'h',
'e',
'a'), 4, 6, &metrics, 0) == noErr) {
1160 props.
ascent = metrics.ascender;
1161 props.
descent = -metrics.descender;
1162 props.
leading = metrics.linegap;
1164 bbox.xMax - bbox.xMin,
1165 bbox.yMax - bbox.yMin);
1171 if (ATSFontGetTable(atsFont,
MAKE_TAG(
'p',
'o',
's',
't'), 10, 2, &lw, 0) == noErr)
1177 if (ATSFontGetPostScriptName(FMGetATSFontRefFromFont(
fontID), kATSOptionFlagsDefault, &psName) == noErr)
1185 ATSUStyle unscaledStyle;
1186 ATSUCreateAndCopyStyle(
style, &unscaledStyle);
1190 const int maxAttributeCount = 4;
1191 ATSUAttributeTag tags[maxAttributeCount + 1];
1192 ByteCount sizes[maxAttributeCount + 1];
1193 ATSUAttributeValuePtr
values[maxAttributeCount + 1];
1194 int attributeCount = 0;
1196 Fixed size = FixRatio(emSquare, 1);
1197 tags[attributeCount] = kATSUSizeTag;
1198 sizes[attributeCount] =
sizeof(size);
1199 values[attributeCount] = &size;
1202 Q_ASSERT(attributeCount < maxAttributeCount + 1);
1203 OSStatus err = ATSUSetAttributes(unscaledStyle, attributeCount, tags, sizes, values);
1209 ATSGlyphScreenMetrics atsuMetrics;
1210 ATSUGlyphGetScreenMetrics(unscaledStyle, 1, &atsuGlyph, 0,
1215 metrics->
width = int(atsuMetrics.width);
1216 metrics->
height = int(atsuMetrics.height);
1225 ATSUDisposeStyle(unscaledStyle);
1227 #endif // !QT_MAC_USE_COCOA
virtual QFixed lineThickness() const
static void addGlyphsToPathHelper(ATSUStyle style, glyph_t *glyphs, QFixedPoint *positions, int numGlyphs, QPainterPath *path)
virtual FaceId faceId() const
static CGColorSpaceRef macGenericColorSpace()
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int numGlyphs, QPainterPath *path, QTextItem::RenderFlags)
QCFType< CGFontRef > cgFont
virtual int glyphCount() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
virtual bool canRender(const QChar *string, int len)
char * data()
Returns a pointer to the data stored in the byte array.
QFixed m_averageCharWidth
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual QFixed ascent() const
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
void fill(uint pixel)
Fills the entire image with the given pixelValue.
The QByteArray class provides an array of bytes.
static OSStatus closePath(void *)
ATSUTextLayout textLayout
void closeSubpath()
Closes the current subpath by drawing a line to the beginning of the subpath, automatically starting ...
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const
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.
static LibLoadStatus status
unsigned int styleStrategy
int bytesPerLine() const
Returns the number of bytes per image scanline.
void qGamma_correct_back_to_linear_cs(QImage *image)
static OSStatus lineTo(const Float32Point *, void *)
bool ref()
Atomically increments the value of this QAtomicInt.
static OSStatus cubicTo(const Float32Point *, const Float32Point *, const Float32Point *, void *)
The QString class provides a Unicode character string.
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
QGlyphLayout mid(int position, int n=-1) const
static QFixed fromReal(qreal r)
bool isHighSurrogate() const
Returns true if the QChar is the high part of a utf16 surrogate (ie.
The QChar class provides a 16-bit Unicode character.
void draw(CGContextRef ctx, qreal x, qreal y, const QTextItemInt &ti, int paintDeviceHeight)
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
bool stringToCMapInternal(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags, ShaperItem *item) const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
int fontIndexForFontID(ATSUFontID id) const
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
virtual ~QFontEngineMac()
#define MAKE_TAG(ch1, ch2, ch3, ch4)
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
static OSStatus moveTo(const Float32Point *, void *)
QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round=false)
#define QT_BEGIN_NAMESPACE
This macro expands to.
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. ...
QImage imageForGlyph(glyph_t glyph, int margin, bool colorful)
Helper function for alphaMapForGlyph and alphaRGBMapForGlyph.
QMacFontPath(float _x, float _y, QPainterPath *_path)
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
static const QCssKnownValue positions[NumKnownPositionModes - 1]
QFontEngineMacMulti(const ATSFontFamilyRef &atsFamily, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning)
QFontEngineMacMulti * multiEngine
virtual qreal maxCharWidth() const
bool deref()
Atomically decrements the value of this QAtomicInt.
virtual QFixed descent() const
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
void append(const T &t)
Inserts value at the end of the vector.
Q_CORE_EXPORT void qWarning(const char *,...)
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *numGlyphs, QTextEngine::ShaperFlags flags) const
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
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...
int qt_antialiasing_threshold
static unsigned int getChar(const QChar *str, int &i, const int len)
const T & at(int i) const
Returns the item at index position i in the vector.
QVector< QFontEngine * > engines
virtual ~QFontEngineMacMulti()
quint16 qFromBigEndian< quint16 >(const uchar *src)
QByteArray postscriptName
virtual bool canRender(const QChar *string, int len)
int length() const
Same as size().
const char * constData() const
Returns a pointer to the data stored in the byte array.
Q_GUI_EXPORT_INLINE int qGray(int r, int g, int b)
uchar * bits()
Returns a pointer to the first pixel data.
const HB_CharAttributes * charAttributes
friend class QFontEngineMac
int width() const
Returns the width of the image.
struct CGColorSpace * CGColorSpaceRef
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily)
QFontEngineMacMulti::ShaperItem * shaperItem
QTextEngine::ShaperFlags flags
static OSStatus atsuPostLayoutCallback(ATSULayoutOperationSelector selector, ATSULineRef lineRef, URefCon refCon, void *operationExtraParameter, ATSULayoutOperationCallbackStatus *callbackStatus)
virtual QImage alphaMapForGlyph(glyph_t)
const unsigned char * cmap
int height() const
Returns the height of the image.
static uint surrogateToUcs4(ushort high, ushort low)
Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point...
const QFontEngineMac * engineAt(int i) const
int size() const
Returns the number of bytes in this byte array.
virtual Properties properties() const
void cubicTo(const QPointF &ctrlPt1, const QPointF &ctrlPt2, const QPointF &endPt)
Adds a cubic Bezier curve between the current position and the given endPoint using the control point...
QFixed effectiveAdvance(int item) const
unsigned short * log_clusters
HB_GlyphAttributes * attributes
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
void setPosition(float _x, float _y)
CGAffineTransform transform
virtual QFixed leading() const
QFontEngineMac(ATSUStyle baseStyle, ATSUFontID fontID, const QFontDef &def, QFontEngineMacMulti *multiEngine=0)
static QFixed kerning(int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
virtual QFixed averageCharWidth() const
virtual QFixed xHeight() const
QTextEngine::ShaperFlags flags
struct CGContext * CGContextRef
virtual void loadEngine(int at)
virtual QByteArray getSfntTable(uint tag) const
#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 void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual qreal maxCharWidth() const
Q_DECL_CONSTEXPR int qRound(qreal d)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
static qreal toReal(Register *reg, int type, bool *ok=0)
Qt::LayoutDirection direction
CGAffineTransform transform