Repository navigation
print: prefer metric-compatible font substitutes, support RVTIO_FONTS - #250
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.