Changes between Version 2 and Version 3 of ComplexTextController


Ignore:
Timestamp:
Jan 26, 2017 8:16:05 PM (7 years ago)
Author:
mmaxfield@apple.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ComplexTextController

    v2 v3  
    2828We 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.
    2929
    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.
     30In 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.
    3131
    3232adjustGlyphsAndAdvances() 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.