PaperForge.Fonts.Builtin (PaperForge v0.2.0)

Copy Markdown View Source

Definitions for the 14 standard PDF fonts.

These fonts can be used without embedding an external font file.

Summary

Functions

Returns all built-in font definitions.

Fetches a built-in font definition.

Fetches a built-in font definition and raises for unsupported fonts.

Returns all supported font keys.

Returns whether a font key is supported.

Types

font_key()

@type font_key() ::
  :helvetica
  | :helvetica_bold
  | :helvetica_oblique
  | :helvetica_bold_oblique
  | :times_roman
  | :times_bold
  | :times_italic
  | :times_bold_italic
  | :courier
  | :courier_bold
  | :courier_oblique
  | :courier_bold_oblique
  | :symbol
  | :zapf_dingbats

Functions

all()

@spec all() :: [map()]

Returns all built-in font definitions.

fetch(font_key)

@spec fetch(term()) :: {:ok, map()} | :error

Fetches a built-in font definition.

Returns {:ok, definition} or :error.

fetch!(font_key)

@spec fetch!(font_key()) :: map()

Fetches a built-in font definition and raises for unsupported fonts.

keys()

@spec keys() :: [font_key()]

Returns all supported font keys.

valid?(font_key)

@spec valid?(term()) :: boolean()

Returns whether a font key is supported.