PaperForge.Font (PaperForge v0.2.0)

Copy Markdown View Source

Represents a standard 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

family()

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

style()

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

t()

@type t() :: %PaperForge.Font{
  base_font: binary(),
  encoding: encoding(),
  family: family(),
  key: atom(),
  reference: PaperForge.Reference.t(),
  resource_name: binary(),
  style: style()
}

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.