mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 18:56:55 -06:00
Given a family and no font style, text.create and text.createInPath kept the default Regular, and text.setStyle kept the text's previous style, even when the family has no such style. A family whose styles are numbered (Hiragino W3, W6) has no Regular, so the file named a font that isn't installed and opened with Missing Fonts. They now keep the style when the family has it, else take the family's closest one, as text.setRangeStyle already did. Its rule moves to `textedit::fit_font_style`, which the three commands share; Graph labels styled through text.setStyle follow it too. A style the caller names is kept as given. The test builds a family with W3 and W6 and no Regular in code (`test_fonts::numbered_font`), so no font file is added.