line-render-index ( line -- regions )


Vocabulary
core-text

Inputs
linean object


Outputs
regionsan object


Definition


:: line-render-index ( line -- regions )
line render-index>>
[ ] [
V{ } clone :> regions line line>> CTLineGetGlyphRuns
CF>array [ regions add-run-regions ] each regions
[ left>> ] sort-by :> sorted -1/0. :> right! sorted [|
region |
right region right>> max
right! right region max-right<<
] each sorted dup line render-index<<
] if* ;