Simple text panel for use with EGD
This text panel implements the Erlang I/O server protocol so write text to
it with IO.puts and the like.
Example:
{:ok, io} = EgdTextPanel.start_link(your_options)
IO.puts(io, "Hello")
Summary
Types
@type margins() :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
Text panel margins within the image dimensions
Fields are left, top, right, bottom margins in pixels
@type options() :: [ renderer: module(), renderer_state: term(), margins: margins(), font_path: Path.t(), width: pos_integer(), height: pos_integer(), font_color: atom() | {byte(), byte(), byte()}, name: GenServer.name() ]
Options for start_link/1
:font_color- a supported EGD font color atom or a 3-tuple with RGB values. Defaults to:black:font_path- path to the font to use. Defaults to EGD's built-in font:height- image height. Defaults to 200.:margins- margins as a 4-tuple. Defaults to{0, 0, 0, 0}:name- a name for theGenServer:renderer- the module that implements theEgdTextPanel.Renderer. Required.:renderer_state- the initial state for the behaviour. Defaults to%{}:width- image width. Defaults to 320.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(options()) :: GenServer.on_start()
Starts an EGD text panel
See options/0 for options. :renderer is the only required option.