Handbook
Glossary
line-metrics ( font string -- metrics )
Factor handbook
»
UI framework
»
Implementing new gadgets
»
Customizing gadget appearance
»
Implementing custom drawing logic
»
Rendering text
Prev:
text-height ( font text -- h )
Next:
x>offset ( x font string -- n )
Vocabulary
ui
.
text
Inputs
font
a
font
string
a
string
Outputs
metrics
a
line-metrics
Generic word contract
Outputs a
metrics
object with text measurements.
Definition
USING:
ui.text.private
;
IN:
ui.text
HOOK:
line-metrics
font-renderer
( font string -- metrics )
Methods
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
;