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;
bool isLowSurrogate() const
Returns true if the QChar is the low part of a utf16 surrogate (ie.
unsigned int styleStrategy
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.
const HB_CharAttributes * charAttributes
QFontEngineMacMulti::ShaperItem * shaperItem
QTextEngine::ShaperFlags flags
unsigned short * log_clusters
HB_GlyphAttributes * attributes
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...