mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 10:45:45 +00:00
Type read from a text document's font record was set in whichever installed face first answered to the record's PostScript name (ignoring case and punctuation), and its family was then swapped for any available family spelled alike but for case and punctuation (`FontDb::find_family`): a record naming `SampleInk`, the PostScript name of `Sample/Ink`, set its type in `SAMPLE INK`. Copies of one family and style under other PostScript names or versions were not told apart either, so the type could set at other widths than the file's own page. - `named_font` / `document_font` (crates/eps/src/import/text.rs) give the family and style of the installed face of exactly that PostScript name, else one that differs only in case or punctuation, and name its version when the family and style alone resolve to another installed copy. - The font record's key 5, its version string (name ID 5), is read and picks that version among the faces of the name. Each record is resolved once. - `FontDb::postscript_faces` lists every installed face a PostScript name answers to, loading their families; the import prefers among them one of exactly that name. - Type a PostScript program sets (EPS import) and legacy .ai type take the face of their font's name the same way. - The .ai save writes a static font's version (`/5`) when its PostScript name alone would give the reader another installed copy (another version, or the same name in another family), keeps the version in the style it compares, and checks that the type comes back in the same family, style and face, taking the record's version as the reader does (up to 256 bytes), so such type round-trips without a note. Measured on 224 users' files (used locally, never committed): 16 files set some type in another face; 12 render differently against their own page, 10 closer and 2 further by 0.03% of the page; envelopes of type that open live go from 154 to 159, none fewer in any file; no file opens another way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>