NativeElixirPdfUtilities.HtmlToPdf.FontFallback (native_elixir_pdf_utilities v0.13.0)

View Source

Resolves styled text graphemes to fonts before layout and PDF writing.

The selected CSS face is tried first, followed by the remaining requested families, configured font faces, and the bundled fallback faces. Adjacent graphemes using the same face remain one text node so layout can measure and wrap the final font runs.

Summary

Functions

Resolves every styled text node to font faces that contain its graphemes.

Types

error_reason()

@type error_reason() ::
  :invalid_document | :invalid_encoding | :invalid_options | :unsupported_glyph

styled_tree()

unsupported_glyphs()

@type unsupported_glyphs() :: :replace | :error

Functions

resolve(styled_tree, unsupported_glyphs \\ :replace)

Resolves every styled text node to font faces that contain its graphemes.

Unsupported graphemes are replaced with U+FFFD by default. Pass :error as the second argument to return an :unsupported_glyph diagnostic instead.