resolveFont

fun resolveFont(font: PdfFont, weight: FontWeight, style: FontStyle): ResolvedFont

Maps a PdfFont reference plus the desired weight and style to a concrete ResolvedFont that the renderer can register and draw with.

Resolution rules:

  • PdfFont.Default cascades into one of the four bundled Inter variants based on weight (>= 600 → bold) and style (italic / upright).

  • PdfFont.System is used as-is — the renderer will look it up in the platform font registry and fall back to Inter Regular if missing.

  • PdfFont.Custom returns a resolved entry pointing at the user's bytes.

The function is pure; calling it many times for the same inputs returns equivalent values without side effects.