PaperForge.Font (PaperForge v0.3.0)

Copy Markdown View Source

Represents a PDF font registered inside a document.

Summary

Functions

Builds the PDF dictionary directly from a built-in font definition.

Creates a registered font from a built-in font definition.

Builds the PDF dictionary for a registered font.

Types

encoding()

@type encoding() :: :win_ansi | :builtin | :identity_h

family()

@type family() ::
  :helvetica | :times | :courier | :symbol | :zapf_dingbats | :truetype

kind()

@type kind() :: :builtin | :truetype

style()

@type style() :: :regular | :bold | :italic | :bold_italic

t()

@type t() :: %PaperForge.Font{
  base_font: binary(),
  cid_font_reference: PaperForge.Reference.t() | nil,
  encoding: encoding(),
  family: family(),
  key: atom(),
  kind: kind(),
  number_of_glyphs: non_neg_integer() | nil,
  reference: PaperForge.Reference.t(),
  resource_name: binary(),
  style: style(),
  to_unicode_reference: PaperForge.Reference.t() | nil,
  unicode_to_gid: map() | nil,
  units_per_em: pos_integer() | nil,
  used_glyphs: MapSet.t(non_neg_integer()) | nil,
  widths: map() | nil
}

Functions

definition_to_dictionary(definition)

@spec definition_to_dictionary(map()) :: map()

Builds the PDF dictionary directly from a built-in font definition.

This function can be used before the font receives its indirect object reference and resource name.

new(definition, resource_name, reference)

@spec new(map(), binary(), PaperForge.Reference.t()) :: t()

Creates a registered font from a built-in font definition.

to_dictionary(font)

@spec to_dictionary(t()) :: map()

Builds the PDF dictionary for a registered font.

true_type(key, font, resource_name, reference, options \\ [])

Creates a registered TrueType font.