NativeElixirPdfUtilities.HtmlToPdf.FontFallback (native_elixir_pdf_utilities v0.13.0)
View SourceResolves 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
@type error_reason() ::
:invalid_document | :invalid_encoding | :invalid_options | :unsupported_glyph
@type styled_tree() :: NativeElixirPdfUtilities.HtmlToPdf.Style.styled_tree()
@type unsupported_glyphs() :: :replace | :error
Functions
@spec resolve(styled_tree(), unsupported_glyphs()) :: {:ok, styled_tree()} | {:error, {error_reason(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
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.