-
Tor Lillqvist yazdı
It no longer gets stuck in a loop so easily. The key thing I realized was that there is a fundamental difference to how the ATSUI and CoreText APIs handle text buffers and the start offsets into them: ATSUCreateTextLayoutWithTextPtr() takes a pointer to the whole buffer, plus start offset and length. These are stored as part of the layout object. Other ATSUI calls that use the layout object interpret index parameters as relative to the buffer start, not relative to the start offset of the layout object. CTTypesetterCreateWithAttributedString() on the other hand takes an attributed string that has been created from a CFString that already is based on a potential substring of a buffer. I.e. the CTTypesetter has no knowledge of the original buffer. All index parameters are relative to that substring of the buffer, as are return values. Change-Id: I7026f323d90a72e1ae1784a69f521e347baffaea
ef7b1133