mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 02:07:09 -06:00
macOS lists fonts such as the ones Microsoft Office installs in /Library/Fonts/Microsoft (Bookman Old Style, Impact, Georgia, Tahoma, ...) but their files have nothing in the data fork and no font extension: the fonts are `sfnt` resources in the resource fork. The font scan only read data forks of .ttf/.otf/.ttc/.otc files, so those families were never cataloged and a file using one (an EPS naming BookmanOldStyle-Bold) showed the font as missing. The scan now catalogs a file with an empty data fork and a resource fork by the fonts in that fork, and loading reads them the same way. The fork reader (crates/text/src/suitcase.rs) follows Apple's published resource file format, caps what a damaged fork can make it read and never panics. macOS only. Tests: the fork reader on a synthetic fork built around a bundled font, including truncated and garbage forks; a macOS scan of a suitcase file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>