View Source Scenic.Primitive.Text (Scenic v0.11.2)
Draw text on the screen.
data
Data
text
The data for a Text primitive is a bitstring
text- the text to draw
styles
Styles
This primitive recognizes the following styles
hidden- show or hide the primitivescissor- "scissor rectangle" that drawing will be clipped to.fill- fill in the area of the text. Only solid colors!font- name (or key) of font to usefont_size- point size of the fonttext_align- horizontal alignment of lines of texttext_base- vertical alignment of lines of textline_height- spacing between lines of text
usage
Usage
You should add/modify primitives via the helper functions in
Scenic.Primitives
graph
|> text( "Some example text", fill: :green, font: :roboto_mono, font_size: 64 )
Link to this section Summary
Functions
Returns a list of styles recognized by this primitive.
Link to this section Types
@type styles_t() :: [
:hidden
| :scissor
| :font
| :font_size
| :line_height
| :text_align
| :text_base
| :line_height
]
@type t() :: String.t()
Link to this section Functions
@spec valid_styles() :: styles_t()
Returns a list of styles recognized by this primitive.