Handbook
Glossary
add-run-regions ( run regions -- )
Vocabulary
core-text
Inputs
run
an
object
regions
an
object
Outputs
None
Definition
USING:
accessors
byte-arrays
core-foundation
core-foundation.dictionaries
core-text.fonts
kernel
layouts
math
math.order
sequences
;
IN:
core-text
::
add-run-regions
( run regions -- )
run
CTRunGetGlyphCount
:>
count count
zero?
[
run
CTRunGetAttributes
kCTFontAttributeName
CFDictionaryGetValue
CTFontGetBoundingBox
:>
bounds run
CTRunGetStatus
kCTRunStatusHasNonIdentityMatrix
bitand
zero?
[
run
CTRunGetPositionsPtr
[
]
[
count
cell
2
*
*
<byte-array>
:>
positions run 0 count
<CFRange>
positions
CTRunGetPositions
positions
]
if*
:>
positions count 255
+
256
/i
<iota>
[|
i |
run positions i 256
*
count i 256
*
-
256
min
bounds regions
length
<glyph-region>
regions
push
]
each
]
[
glyph-region
new
run
>>run
0 count
<CFRange>
>>range
-1/0.
>>left
1/0.
>>right
regions
length
>>order
regions
push
]
if
]
unless
;