View Source Chisel.Renderer (chisel v0.2.1)
The renderer is capable of draw the text on any target using for that a function that receives the x, y coordinates of the pixel to be painted.
Summary
Types
Use size_x
and size_y
options to scale up the font.
The function used to paint the canvas.
The function used to paint the canvas.
Functions
Draws a character using the codepoint
Draws an string
Gets the size of the rendered string using the font and options provided
Draws a character using the codepoint calling a reducer function.
Draws an string calling a reducer function
Types
@type acc() :: any()
Use size_x
and size_y
options to scale up the font.
The function used to paint the canvas.
Chisel will use this function to draw the text.
The function used to paint the canvas.
Chisel will use this function to draw the text.
Functions
@spec draw_char( codepoint :: integer(), clx :: integer(), cly :: integer(), font :: Chisel.Font.t(), put_pixel :: pixel_fun(), opts :: draw_options() ) :: {x :: integer(), y :: integer()}
Draws a character using the codepoint
The coordinates (tlx
, tly
) are for the top left corner.
@spec draw_text( text :: String.t(), tlx :: integer(), tly :: integer(), font :: Chisel.Font.t(), put_pixel :: pixel_fun(), opts :: draw_options() ) :: {x :: integer(), y :: integer()}
Draws an string
The coordinates (tlx
, tly
) are for the top left corner.
@spec get_text_width( text :: String.t(), font :: Chisel.Font.t(), opts :: draw_options() ) :: integer()
Gets the size of the rendered string using the font and options provided
reduce_draw_char(codepoint, clx, cly, font, acc, reduce_pixel, opts \\ [])
View Source@spec reduce_draw_char( codepoint :: integer(), clx :: integer(), cly :: integer(), font :: Chisel.Font.t(), acc :: acc(), reduce_pixel :: reduce_pixel_fun(), opts :: draw_options() ) :: {acc :: acc(), x :: integer(), y :: integer()}
Draws a character using the codepoint calling a reducer function.
The coordinates (tlx
, tly
) are for the top left corner.
reduce_draw_text(text, tlx, tly, font, acc, reduce_pixel, opts \\ [])
View Source@spec reduce_draw_text( text :: String.t(), tlx :: integer(), tly :: integer(), font :: Chisel.Font.t(), acc :: acc(), reduce_pixel :: reduce_pixel_fun(), opts :: draw_options() ) :: {acc :: acc(), x :: integer(), y :: integer()}
Draws an string calling a reducer function
The coordinates (tlx
, tly
) are for the top left corner.