FormatParser.Font (format_parser v2.6.0)
A Font struct and functions.
The Font struct contains the fields format and nature.
Summary
Functions
Parses a font file or result.
Types
@type t() :: %FormatParser.Font{format: atom() | nil, nature: :font}
Functions
Parses a font file or result.
- If given a tuple
{:error, file}wherefileis a binary, attempts to parse the font from the file. - If given a binary
file, attempts to parse the font from the file. - For any other input, returns the input as-is.
Examples
iex> parse({:error, "font.ttf"}) # Parses the font from "font.ttf"
iex> parse("font.ttf") # Parses the font from "font.ttf"
iex> parse(:ok) :ok