mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-27 19:27:21 -06:00
Character: variable fonts get a slider for each axis
VectorCraft listed a variable font's named instances as styles, but
type could not be set between or past them. The reference app's
Character panel has a Variable Font control that adjusts a variable
font's axes, such as Weight, Width and Slant.
Type now keeps Variable Font settings by axis tag
(CharStyle::font_axes, saved as fontAxes only when set). text.setFormat
and text.setRangeStyle take fontAxes: each value is clamped to its
axis's range, a tag the font has no axis for is left out, and null
goes back to the style's own setting. Another font or style clears
them, including one from a character style that does not set them. A
character style captured from type sets them, with {} for none.
text.fontList {family, style} lists a font's axes.
Layout, outlines, the substituted-glyph highlight and PDF export use
the font instanced at the settings, and neighboring runs at different
settings are shaped apart, as runs in different fonts are. SVG export
writes them as font-variation-settings, the wght setting as the weight
and the wdth setting as font-stretch, and embeds the font instanced
there; SVG import reads font-variation-settings back. Legacy .ai export
warns that the settings are left out.
The Character panel shows a Variable Font button for a variable font.
It opens a slider and a field for each axis the font does not hide,
labeled with the font's name for the axis, and screen readers get each
slider under that name. A drag is one undo step. Reset Panel leaves
the settings, as it leaves the font and style.
Missing Glyph Protection now keeps the settings and the font version
on the characters that keep their font; before, it kept only the
family and style. A character style applied or redefined with another
font now clears the old font's version, as text.setStyle does, unless
the style sets one. SVG export with embedded fonts warns when faces of
one weight, style and width share characters, which browsers then draw
in one of the faces.
Docs: docs/mcp.md, docs/target-app-parity.md, docs/type-parity.md.
This commit is contained in:
+24
-1
@@ -3550,6 +3550,27 @@ not kerned). Off by default and saved only when on. One undo step.
|
||||
{"name":"run_command","arguments":{"command":"text.setFormat","params":{"proportionalMetrics":true}}}
|
||||
```
|
||||
|
||||
## Variable fonts
|
||||
|
||||
`text.setFormat {fontAxes: {"wght": 650}}` (the selected type, or `ids`) and `text.setRangeStyle {id, start, end,
|
||||
fontAxes}` (a range) set variation axes of a variable font, as the Character panel's Variable Font sliders do: each tag
|
||||
named takes the value given, in the axis's own units and clamped to its range, in place of the style's setting of that
|
||||
axis, and `null` sets it back to the style's setting. The other axes keep their settings. A tag the font has no axis for is
|
||||
left out, and a value equal to the style's setting is not kept; for a font that isn't installed the values are kept as
|
||||
given. Layout, outlines, the substituted-glyph highlight and PDF export use the font instanced at the settings; SVG export
|
||||
writes them as `font-variation-settings` (and the `wght` setting as the weight, the `wdth` setting as `font-stretch`) and
|
||||
embeds the font instanced there, with a warning when embedded faces of one weight, style and width share characters; SVG
|
||||
import reads `font-variation-settings` back. Another font or style (`text.setStyle {font, style}`, `text.setRangeStyle
|
||||
{font, style}`, `text.replaceFont`, and a character style applied or redefined with another font unless it sets them)
|
||||
clears the settings, and Missing Glyph Protection keeps them on the characters that keep their font. They are saved as
|
||||
`fontAxes` only when set, and a character style captured from type (`charStyle.new`, `charStyle.redefine`) sets them
|
||||
explicitly, `{}` for none. Each command is one undo step.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"text.fontList","params":{"family":"Bahnschrift","style":"Regular"}}}
|
||||
{"name":"run_command","arguments":{"command":"text.setFormat","params":{"fontAxes":{"wght":650,"wdth":87.5}}}}
|
||||
```
|
||||
|
||||
## Digits
|
||||
|
||||
`text.setFormat {digits: "default"|"arabic"|"hindi"|"farsi"}` (the selected type, or `ids`) and `text.setRangeStyle {id,
|
||||
@@ -3720,7 +3741,9 @@ lists every family available, the installed ones included, each by its English (
|
||||
`text.setStyle {font}` and documents use — without the system's hidden families, whose names start with "."
|
||||
(macOS's ".SF NS", ".LastResort"), which still resolve when a document names them. Preferences › Type › Show Font
|
||||
Names in English (`fontNamesInEnglish`) only changes the UI menu labels, not this list. With `family` it gives that
|
||||
family's styles (upright by weight, then italics) and fails when the family isn't available. `text.rescanFonts`
|
||||
family's styles (upright by weight, then italics) and fails when the family isn't available; `axes` lists a variable
|
||||
font's variation axes (`tag`, `name`, `min`, `default`, `max`, `hidden`, and `value`, the setting of `style`, else of the
|
||||
first style), empty for a static font. `text.rescanFonts`
|
||||
(Character panel menu › Refresh Font List) scans the font folders again, for fonts installed or removed since the app
|
||||
started: type set in a font that became available redraws in it, and type set in a family that was removed redraws in
|
||||
the fallback font and is listed as missing, without editing the document. The app does so by
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -31,7 +31,7 @@ against Illustrator's public documentation; **estimated** unless noted.
|
||||
| Font menu: samples, live preview, filters, favourites; font matching by any name; Find Font | done | #339; script filter: Japanese, Latin, Thai; the font scan on Linux also reads the folders fontconfig's configuration lists, such as TeX fonts under `/usr/share/texmf/fonts` (#1548, fixes #1529; not verified on Linux) |
|
||||
| Missing glyphs set in an installed font made for their script (Thai, Lao, Khmer, Myanmar first; then any font that has them) | done | Thai: Leelawadee UI, Tahoma, Thonburi, Sukhumvit Set, Noto Sans Thai, TLWG |
|
||||
| Full font-name matching (OpenType name ID 4) | done | #1258: loaded/cataloged faces and Missing Fonts searches; localized names and variable default faces; Windows font-service QA pending |
|
||||
| Variable fonts | partial | named instances as styles; axis sliders missing |
|
||||
| Variable fonts | partial | named instances as styles; Character panel › Variable Font sets each axis (`fontAxes`); the font menu's Variable filter is missing |
|
||||
| Colour fonts (OpenType SVG / COLR) | partial | |
|
||||
| Every-line and Single-line composers | done | tuned by eye, never compared side by side |
|
||||
| Optical Margin Alignment | done | Type › Optical Margin Alignment, `type.opticalMarginAlignment`: per type object, in point and area type of left-to-right paragraphs; type on a path and right-to-left paragraphs do not hang |
|
||||
|
||||
Reference in New Issue
Block a user