Skip to content

print: prefer metric-compatible font substitutes, support RVTIO_FONTS - #250

Merged
mahach666 merged 3 commits into
mainfrom
feat/font-substitutes
Nov 16, 2026
Merged

mahach666 merged 3 commits into
mainfrom
feat/font-substitutes

Conversation

@mahach666

Copy link
Copy Markdown
Collaborator

Port rvt-prt font lookup (docs/configuration.md#fonts).\n\n- Linux candidates now prefer Arial's metric-compatible substitutes (Liberation Sans, Arimo) over DejaVu Sans, so titles wrap the same on every machine; Windows/macOS order unchanged.\n- RVTIO_FONTS names extra folders of font files searched first (: on Linux/macOS, ; on Windows), as in rvt-prt's RVT_PRT_FONTS.\n- Behavior without the env var and without substitute fonts installed is unchanged (falls through to DejaVu/system fonts).\n- Docs: docs/printing.md, docs/public-api.md, CHANGELOG. Tests: PdfFontsTests (3, order/env parsing, no disk writes).\n\nNo Autodesk code.

Port rvt-prt font lookup: Liberation Sans and Arimo (Arial-compatible widths, titles wrap the same everywhere) before DejaVu Sans on Linux; RVTIO_FONTS names extra font folders searched first. Tests: PdfFontsTests; docs updated.
Review #250: a 16-byte RVTIO_FONTS arial.ttf threw ArgumentOutOfRangeException and aborted TryFind instead of falling back to system Arial. PdfTrueTypeFont now bounds-checks the table directory and each table/cmap read (Need helper) and reports truncation as NotSupportedException (out-of-range reads also mapped). TryFind also tolerates ArgumentException from malformed input. Adds Debian Bookworm liberation2 candidate path. Tests cover truncated rejection and corrupt-preferred fallback.
@mahach666
mahach666 merged commit dfe92cf into main Nov 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant