Font descriptor for the text widget font prop and Settings default_font.
Maps to iced's Font struct. Accepts :default, :monospace, a family
name string, or a map with :family, :weight, :style, and :stretch.
Summary
Functions
Encodes a font value to the wire format.
Types
@type stretch() ::
:ultra_expanded
| :extra_expanded
| :expanded
| :semi_expanded
| :normal
| :semi_condensed
| :condensed
| :extra_condensed
| :ultra_condensed
@type style() :: :oblique | :italic | :normal
@type weight() ::
:black
| :extra_bold
| :bold
| :semi_bold
| :medium
| :normal
| :light
| :extra_light
| :thin
Functions
Encodes a font value to the wire format.
Examples
iex> Toddy.Iced.Font.encode(:default)
"default"
iex> Toddy.Iced.Font.encode(:monospace)
"monospace"
iex> Toddy.Iced.Font.encode("Fira Code")
%{"family" => "Fira Code"}
iex> Toddy.Iced.Font.encode(%{family: "Inter", weight: :bold, style: :italic})
%{"family" => "Inter", "weight" => "Bold", "style" => "Italic"}