Type: Kerning has an Optical option that spaces characters by their shapes

Squashed from #4825 onto main.
This commit is contained in:
dotCooCoo
2026-11-01 01:22:04 +07:00
committed by bflatastic
parent 012af4fd49
commit 9896f633da
47 changed files with 1165 additions and 69 deletions
+12 -1
View File
@@ -3217,7 +3217,8 @@ Pen's second anchor at (150, 431), in line with the square's centre.
leading (↑/↓ in horizontal type, ←/→ in vertical type), and baseline shift (Shift+↑/↓ in horizontal type,
Shift+→/← in vertical type). Mixed selected text objects use the horizontal mapping; Cmd/Ctrl makes five steps.
`type.resetTracking` (Cmd+Alt+Q, `press_key {key: "Q", mods: {cmd: true, alt: true}}`) sets tracking to 0 and
kerning to Auto in the type objects in `ids`, the Type tool's selected text or the selected type objects; at a caret
clears manual kerning in the type objects in `ids`, the Type tool's selected text or the selected type objects,
keeping Optical; at a caret
it resets only the kerning of the character before it. `type.resetHorizontalScale` (Cmd+Shift+X,
`press_key {key: "X", mods: {cmd: true, shift: true}}`) sets the horizontal scale to 100%, as the Character panel
shows it, in the same text; at a caret it leaves the text as it is. In the app, `type.highlightKerning` (Cmd+Alt+K),
@@ -4918,6 +4919,16 @@ the paragraph's text now starts; when the text before `at` starts no list, nothi
{"name":"run_command","arguments":{"command":"text.convertListToText","params":{}}}
```
## Kerning
`text.setRangeStyle {id, start, end, kerning}` (a range) and `text.setFormat {ids?, kerning}`
(the selected type) accept `kerning: "auto" | "optical" | number` (1/1000 em). Auto uses the font's
pair metrics; Optical spaces horizontal pairs from their glyph shapes. Vertical text uses font
metrics in either mode. A number sets a manual pair value,
replacing that pair's automatic correction while tracking remains additive. Choosing Optical keeps
existing manual pair values; choosing `"auto"` clears them. New text and files without an Optical setting use Auto. The Character
panel offers both automatic modes.
## Small Caps, Superscript and Subscript
`text.setFormat {smallCaps, position}` (the selected type, or `ids`) and `text.setRangeStyle {id, start, end, smallCaps,
position}` (a range) set what the Character panel's Small Caps, Superscript and Subscript buttons and menu items set.
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -24,7 +24,7 @@ can use installed system fonts, while the web app uses the fonts supplied by its
6. Adjust **Font Size** (the field beside **T**) and **Tracking** (beside **VA↔**) in the Character
panel. Hover a field's label to see its name. For example, enter `72 pt` for a large heading and
try tracking `50` to spread its letters slightly. Positive tracking adds space; negative tracking
tightens it. **Leading** controls the spacing between lines; **Kerning (0 = Auto)** adjusts pairs.
tightens it. **Leading** controls the spacing between lines; **Kerning** adjusts pairs.
7. To change only part of the text, select **Type Tool**, click into the text and drag across the
characters before using the Character panel. Press **Escape** when finished. Keep the text
editable until its wording, font and spacing are settled.