Rendro.Text (Rendro v0.3.0)

Copy Markdown View Source

Text content with logical font, size, and color attributes.

font is a public authoring reference, not a PDF writer resource name. Prefer logical names such as :body or :heading that the document resolves through its owned font registry. A narrow Helvetica compatibility path remains available for the current built-in default behavior.

Summary

Functions

Returns the current narrow compatibility default for authored text.

Normalizes a public font reference.

Types

compatibility_font_alias()

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

font_ref()

@type font_ref() :: logical_font_name() | compatibility_font_alias()

logical_font_name()

@type logical_font_name() :: atom()

t()

@type t() :: %Rendro.Text{
  color: {non_neg_integer(), non_neg_integer(), non_neg_integer()},
  content: String.t(),
  font: font_ref(),
  line_height: float(),
  orphans: non_neg_integer(),
  size: number(),
  widows: non_neg_integer()
}

Functions

default_font()

@spec default_font() :: String.t()

Returns the current narrow compatibility default for authored text.

normalize_font(font)

@spec normalize_font(font_ref()) :: font_ref()

Normalizes a public font reference.

Logical font atoms are passed through unchanged. String compatibility aliases are intentionally narrow and currently only support Helvetica.