Factor handbook » UI framework » Implementing new gadgets » Customizing gadget appearance » Implementing custom drawing logic » Rendering text

Next:text-dim ( font text -- dim )

The fonts vocabulary implements a data type for fonts that other vocabularies, for example UI framework, can use. A font combines a font name, size, style, and color information into a single object.

<font> ( -- font )

Modifying fonts:
font-with-foreground ( font color -- font' )

font-with-background ( font color -- font' )

Useful constants:
monospace-font ( -- font )

sans-serif-font ( -- font )

serif-font ( -- font )

A data type for font metrics. The fonts vocabulary does not provide any means of computing font metrics, it simply defines a common data type that other vocabularies, such as ui.text may use: