Handbook
Glossary
line-render-index ( line -- regions )
Vocabulary
core-text
Inputs
line
an
object
Outputs
regions
an
object
Definition
USING:
accessors
core-foundation.arrays
kernel
math.order
sequences
sorting
;
IN:
core-text
::
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*
;