Changes between Version 2 and Version 3 of ComplexTextController
- Timestamp:
- Jan 26, 2017, 8:16:05 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ComplexTextController
v2 v3 28 28 We want to convert this information into two sequences of information: layout advances and paint advances. Paint advances are the advances you pass to CTFontDrawGlyphs, and therefore, has an “initial paint advance” which points to the first glyph’s paint location. On the other hand, layout advances always start at the origin. 29 29 30 In the example above, the initial paint advance is vector pr, and the subsequent paint advances are vectors rs, sw, and wy. The layout advances are vectors pt, tx, and ty (“pt” is not a typo). This has the nice property that the sum of the paint advances is equal to the sum of the layout advances.30 In the example above, the initial paint advance is vector pr, and the subsequent paint advances are vectors rs, sw, and wy. The layout advances are vectors pt, tx, and xy (“pt” is not a typo). This has the nice property that the sum of the paint advances is equal to the sum of the layout advances. 31 31 32 32 adjustGlyphsAndAdvances() is the place which performs this conversion. There can be multiple ComplexTextRuns represented by the ComplexTextController, and if there are two, they are joined together at points p and y (the leftmost ComplexTextRun’s y point is coincident with the rightmost ComplexTextRun’s p point). When this happens, character C’s paint advance has to be between the leftmost ComplexTextRun’s w point and the rightmost ComplexTextRuns’ r point. The layout advances are unchanged in this situation.