plushie/prop/font

Font types for text rendering.

Covers font family selection, weight, style, and stretch. DefaultFont and Monospace are simple variants; Family picks a named font; CustomFont allows full control over weight, style, and stretch.

Types

pub type Font {
  DefaultFont
  Monospace
  Family(String)
  CustomFont(
    family: String,
    weight: FontWeight,
    style: FontStyle,
    stretch: FontStretch,
  )
}

Constructors

pub type FontStretch {
  UltraCondensed
  ExtraCondensed
  Condensed
  SemiCondensed
  NormalStretch
  SemiExpanded
  Expanded
  ExtraExpanded
  UltraExpanded
}

Constructors

  • UltraCondensed
  • ExtraCondensed
  • Condensed
  • SemiCondensed
  • NormalStretch
  • SemiExpanded
  • Expanded
  • ExtraExpanded
  • UltraExpanded
pub type FontStyle {
  NormalStyle
  Italic
  Oblique
}

Constructors

  • NormalStyle
  • Italic
  • Oblique
pub type FontWeight {
  Thin
  ExtraLight
  Light
  Normal
  Medium
  SemiBold
  Bold
  ExtraBold
  Black
}

Constructors

  • Thin
  • ExtraLight
  • Light
  • Normal
  • Medium
  • SemiBold
  • Bold
  • ExtraBold
  • Black

Values

pub fn stretch_to_string(s: FontStretch) -> String

Convert a FontStretch to its wire-format string representation.

pub fn style_to_string(s: FontStyle) -> String

Convert a FontStyle to its wire-format string representation.

pub fn to_prop_value(font: Font) -> node.PropValue

Encode a Font to its wire-format PropValue.

pub fn weight_to_string(w: FontWeight) -> String

Convert a FontWeight to its wire-format string representation.

Search Document