Font specification with family, weight, style, and stretch.
Maps to iced's Font struct. Accepts :default, :monospace, a family
name string, or a %Font{} struct with detailed font properties.
Summary
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> Plushie.Type.Font.encode(:default)
"default"
iex> Plushie.Type.Font.encode(:monospace)
"monospace"
iex> Plushie.Type.Font.encode("Fira Code")
%{family: "Fira Code"}
iex> Plushie.Type.Font.encode(%{family: "Inter", weight: :bold, style: :italic})
%{family: "Inter", weight: "Bold", style: "Italic"}
@spec from_opts(Keyword.t()) :: %Plushie.Type.Font{ family: term(), stretch: term(), style: term(), weight: term() }
Constructs a font from a keyword list.
Raises ArgumentError if any key is not a valid font field.