Handbook
Glossary
core-text-renderer
Vocabulary
ui
.
text
.
core-text
Definition
IN:
ui.text.core-text
SINGLETON:
core-text-renderer
Methods
USING:
cache
core-text
namespaces
ui.text.core-text
ui.text.private
;
M:
core-text-renderer
flush-layout-cache
cached-lines
get-global
purge-cache
;
USING:
core-text.fonts
ui.text
ui.text.core-text
;
M:
core-text-renderer
font-metrics
cache-font-metrics
;
USING:
accessors
core-text
kernel
sequences
ui.text
ui.text.core-text
ui.text.core-text.private
;
M:
core-text-renderer
line-metrics
[
" "
line-metrics
clone
0
>>width
]
[
cached-line
metrics>>
scale-metrics
]
if-empty
;
USING:
accessors
core-text
io.encodings.string
io.encodings.utf16
math
opengl
sequences
ui.text
ui.text.core-text
;
M::
core-text-renderer
offset>x
( n font string -- x )
font string
cached-line
line>>
0 n string
subseq
utf16n
encode
length
2
/i
f
CTLineGetOffsetForStringIndex
gl-unscale
;
USING:
accessors
core-text
math.vectors
sequences
ui.text.core-text
ui.text.core-text.private
ui.text.private
;
M:
core-text-renderer
string-dim
[
" "
string-dim
{
0 1
}
v*
]
[
cached-line
dim>>
scale-dim
]
if-empty
;
USING:
accessors
core-text
kernel
ui.text
ui.text.core-text
ui.text.core-text.private
;
M:
core-text-renderer
string>image
cached-line
[
line>image
]
[
loc>>
scale-dim
]
bi
;
USING:
accessors
core-graphics.types
core-text
io.encodings.string
io.encodings.utf16
kernel
math
opengl
sequences
ui.text
ui.text.core-text
;
M::
core-text-renderer
x>offset
( x font string -- n )
x font string
[
2drop
0
]
[
cached-line
line>>
swap
gl-scale
0
<CGPoint>
CTLineGetStringIndexForPosition
2
*
0
swap
string
utf16n
encode
subseq
utf16n
decode
length
]
if-empty
;