Raxol.Terminal.Font.Manager (Raxol v0.5.0)

View Source

Manages font operations and settings for the terminal, including font family, size, weight, and style.

Summary

Functions

Gets the current custom fonts.

Gets the current fallback fonts.

Gets the current font family.

Gets the complete font stack including fallbacks.

Gets the current letter spacing.

Gets the current line height.

Gets the current font size.

Gets the current font style.

Gets the current font weight.

Creates a new font manager instance with default settings.

Removes a custom font.

Resets the font manager to its initial state.

Sets the fallback fonts.

Sets the font family.

Sets the letter spacing.

Sets the line height.

Sets the font size.

Sets the font style.

Sets the font weight.

Types

custom_fonts()

@type custom_fonts() :: %{required(String.t()) => String.t()}

fallback_fonts()

@type fallback_fonts() :: [font_family()]

font_family()

@type font_family() :: String.t()

font_size()

@type font_size() :: non_neg_integer()

font_style()

@type font_style() :: :normal | :italic | :oblique

font_weight()

@type font_weight() :: :normal | :bold | :lighter | :bolder | 100..900

letter_spacing()

@type letter_spacing() :: number()

line_height()

@type line_height() :: number()

t()

@type t() :: %Raxol.Terminal.Font.Manager{
  custom_fonts: custom_fonts(),
  fallback_fonts: fallback_fonts(),
  family: font_family(),
  letter_spacing: letter_spacing(),
  line_height: line_height(),
  size: font_size(),
  style: font_style(),
  weight: font_weight()
}

Functions

add_custom_font(manager, name, path)

Adds a custom font.

get_custom_fonts(manager)

Gets the current custom fonts.

get_fallback_fonts(manager)

Gets the current fallback fonts.

get_family(manager)

Gets the current font family.

get_font_stack(manager)

Gets the complete font stack including fallbacks.

get_letter_spacing(manager)

Gets the current letter spacing.

get_line_height(manager)

Gets the current line height.

get_size(manager)

Gets the current font size.

get_style(manager)

Gets the current font style.

get_weight(manager)

Gets the current font weight.

new()

Creates a new font manager instance with default settings.

remove_custom_font(manager, name)

Removes a custom font.

reset(manager)

Resets the font manager to its initial state.

set_fallback_fonts(manager, fonts)

Sets the fallback fonts.

set_family(manager, family)

Sets the font family.

set_letter_spacing(manager, spacing)

Sets the letter spacing.

set_line_height(manager, height)

Sets the line height.

set_size(manager, size)

Sets the font size.

set_style(manager, style)

Sets the font style.

set_weight(manager, weight)

Sets the font weight.