Commit Graph
258 Commits
Author SHA1 Message Date
ruchirguitarandClaude Opus 5.5 b87fddba11 Type: Optical kerning spaces pairs by the font's own stem spacing (#5336)
Optical moved every pair all the way to a fixed 0.08 em ink gap, tighter
than most text faces' own stem spacing, so ordinary text was squeezed
(at 100 pt, Source Sans 3 `nn` closed from 54.7 to 46.9 pt).

Each pair now moves 0.6 of the way toward the face's reference gap (the
median ink gap of `nn`, else `HH` or `oo`; 0.08 em when it has none),
keeps at least 0.3 of it at its narrowest, and changes by at most
0.12 em tighter or 0.06 em looser. Ideographs, kana, hangul, fullwidth
and CJK punctuation forms and dashes keep the font's spacing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 03:04:51 +07:00
dotCooCoo fae49d31fd Glyphs: the default glyph can be chosen back under a substituting feature
Follows #5442.

- text.setGlyphAlternate keeps the default glyph as a choice when a
  feature of the character's style (salt, a stylistic set) draws another
  glyph for it, so the default glyph is drawn. A character that is not
  laid out (overflowing text) is shaped alone in its style to decide.
  gid: null reports the glyph the style draws.
- The Glyphs panel's alternates grid shows the default glyph first when
  the font does not list it, so a chosen alternate can be put back.
- A test for a chosen character that starts a longer grapheme (f with a
  combining acute), which is not split from its mark.
- The alternates tests in the engine hold the shared font lock while
  they add fonts to the global font database.
2026-11-04 23:58:54 +07:00
dotCooCoo 88b5170622 Glyphs panel: alternates for the current text selection
Squashed from #5442 onto main.
2026-11-04 22:29:53 +07:00
dotCooCoo e0ebc13a2e Type: right-to-left manual kerning keeps whole-point spacing on both sides
With System Layout on or Fractional Widths off, each advance is rounded
to whole points, but a right-to-left character with manual kerning
still moved by the unrounded kerning value. The difference between the
two changed the space after the character before it in reading order.
The character now moves by the change the kerning makes to its rounded
advance, so only the space before the next character changes.
2026-11-04 22:29:14 +07:00
dotCooCoo d639508a9a Type: baseline shift moves an upright glyph across the column in vertical type
Baseline shift on an upright glyph in vertical type moved it up the column
instead of across it, at any Character Rotation, because the shift was
applied before the glyph was turned upright. The shift is now taken off
before the turn and put back after it, so an upright glyph moves across the
column by the shift as a letter lying on its side does, and still turns
about its shifted pen position.
2026-11-04 21:58:55 +07:00
Don Omondi 0143e0f706 Fix #5483: a large font library no longer keeps the window from opening
The menu bar builds Type > Font in every frame, the first included, and
its family list waited for the scan of every installed font. When that
scan took longer than the 20 s first-frame watchdog (thousands of fonts
on a slow disk, or each file checked by antivirus), the app took the
graphics adapter for hung and started again without it, until none was
left and no window ever showed.

The menu now lists the fonts already loaded until the scan ends, then
all of them (FontDb::menu_family_list_now, installed_fonts_ready).
2026-11-04 21:37:48 +07:00
dotCooCoo 5ebb6796fe Tests: skip the Arabic Optical kerning test without craft-fonts
optical_pair_after_rtl_separate_mark_uses_base_outline sets Noto Sans
Arabic, which is not in assets/fonts. Without CRAFT_FONTS_DIR the font
database returns a fallback face, so the test checked that face instead.
The test now skips when Noto Sans Arabic is missing, as the Shippori
Mincho tests in the same file do.
2026-11-04 18:28:50 +07:00
dotCooCoo 663c3264ca Type: list stylistic sets whose lookups come from FeatureVariations
A variable font can leave an ssNN feature empty in GSUB or GPOS and
supply its lookups through a FeatureVariations substitution. The
OpenType panel skipped those sets because the default feature has no
lookups. A set is now listed when a substitution in a variation record
replaces its feature with one that has lookups, and its name is read
from the default feature or the substituted one.

Records after one without conditions are ignored, and at most 4096
variation records and 4096 substitutions are read per table.

Follows #5447.
2026-11-04 15:41:05 +07:00
dotCooCoo 4fa4862613 Type: translate the numbered stylistic set label
StylisticSet.name now holds only a name the font supplies. The OpenType panel shows a set without one as `Set {n}` through tl!, so the label is translated, and each UI catalog has a `Set {n}` row.
2026-11-04 14:08:30 +07:00
dotCooCoo b72c822f1d Add font-aware OpenType stylistic sets menu 2026-11-04 14:08:30 +07:00
Dylan M. Taylor daf224755a Fonts: cap the name records and decoded bytes read per name id 2026-11-04 10:52:13 +07:00
dotCooCoo 9fd7d0a733 Type: place a contour-point caret on a composite as the outline is drawn
With SCALED_COMPONENT_OFFSET, a component's offset now scales each axis
by the length of that axis's basis vector, as the outline loader does,
instead of going through the whole matrix. A rotated or skewed
component's caret no longer lands away from its drawn point.
UNSCALED_COMPONENT_OFFSET now turns the scaling off when both flags are
set.
2026-11-04 08:12:22 +07:00
dotCooCoo 98ef01a6d3 Type: bound the glyphs a contour-point caret lookup reads
A composite glyph whose components expand into glyphs with no points
could make the contour-point caret lookup read billions of glyphs. The
whole lookup now shares a budget of 65,536 glyph reads and gives no
caret when it runs out, so the caret falls back to dividing the advance.
2026-11-04 08:12:22 +07:00
dotCooCoo 817bfceda3 Resolve GDEF contour-point ligature carets 2026-11-04 08:12:22 +07:00
dotCooCoo cdd014c4e7 Type: the stop inside an upright ligature on a vertical path follows its drawn cell
On a path, vertical type turns an upright glyph about its pen, so its cell
runs from 0.12 em before the pen to 0.88 em after it without the font's
vertical metrics. The ligature caret, a click and the selection measured
the cell from the pen instead. They now take the cell where the glyph's
transform draws it, with its placement, baseline shift, Horizontal Scale
and Skew.
2026-11-04 08:12:18 +07:00
dotCooCoo 1ad74d1ddf Type: reject doubly signed OpenType feature tags 2026-11-04 08:12:12 +07:00
dotCooCoo 63ac1395fd Type: control Kashidas for selected characters 2026-11-03 23:29:52 +07:00
Dylan M. Taylor 670968f60a perf(text): look only at a paragraph's own runs 2026-11-03 23:29:39 +07:00
dotCooCoo 2b63bf1b67 Type: keep composition spacing along the line when characters rotate 2026-11-03 21:38:02 +07:00
dotCooCoo e1ea0ecad1 Type: the caret, a click and the arrow keys reach the characters inside a ligature
Squashed from #5225 onto main.
2026-11-03 16:38:36 +07:00
dotCooCoo 5ba035aba4 Type: an inline graphic takes its character's manual kerning
A manual kerning value on an inline graphic's character was stored and
shown but did not move the text after it. The graphic's advance now
includes the value, as a letter's does, and in right-to-left horizontal
type its art moves right by the value, so the space goes between it and
the next character in reading order. Auto and Optical kerning still apply
no font pairs to an inline graphic.
2026-11-02 03:45:45 -08:00
dotCooCoo e13cf73ae0 Type: Tate-chu-yoko Settings move a block up, down, left or right
Squashed from #5206 onto main.
2026-11-02 14:32:59 +07:00
dotCooCoo 0895eccfe1 Type: right-to-left manual kerning moves a rotated character along the line
Right-to-left manual kerning was added to the glyph's offset, which
Character Rotation turns, so a rotated character with kerning moved
across the line (up at 90 degrees) instead of away from the next
character in reading order. The shift is now applied to the pen
position along the baseline, outside the rotation, and the rotation
turns the glyph about that moved pen position.
2026-11-02 14:32:54 +07:00
dotCooCoo 8346f052e9 Type: manual kerning in right-to-left text spaces the pair it is set on
A manual kerning value on a character in right-to-left text changed the
space between it and the character before it in reading order, under
both Auto and Optical kerning. The shaped glyphs of a right-to-left
cluster now also move right by the value, so the space its advance
gains is at its left, between it and the next character in reading
order. Left-to-right text and tracking are unchanged.

Optical kerning no longer takes the left glyph's manual value off the
advance it measures, since right to left the value is in that glyph's
offset as well.
2026-11-02 14:32:54 +07:00
dotCooCoo 3cb252198a OpenType: the panel's Position menu sets superscript, subscript, numerator or denominator glyphs
The OpenType panel gets a Position menu after Figure, with Default
Position, Superscript, Subscript, Numerator and Denominator. `numr` and
`dnom` join the extra features (the existing bits keep their indices),
so they round-trip through the stored tags and reach the shaper.

text.setStyle and text.setRangeStyle take `featureChanges`, which turns
features on or off on top of each character's own features in one
command and keeps every tag the list does not name. The Figure menu,
the Position menu and the checkboxes send it, so on a selection whose
characters have different features each character keeps its other
features. Reset OpenType Features still sends `features`.

Catalog rows for Position:, Default Position, Numerator and
Denominator; one line each in docs/type-parity.md and
docs/target-app-parity.md.
2026-11-02 12:04:15 +07:00
dotCooCoo beb89ebec4 .ai import: vertical type keeps its orientation and Tate-chu-yoko runs
Squashed from #5086 onto main.
2026-11-02 12:04:08 +07:00
dotCooCoo f46427167c .ai import: area type keeps its rows, columns, gutters and first baseline
Area type made from the editing data's text document came in with one
row, one column, the 18 pt gutter and the Ascent first baseline,
whatever its frame kept. Each area frame now keeps its rows and columns,
the gutter between rows and the gutter between columns, and its first
baseline (Fixed, Cap Height, Leading or x Height) with its minimum,
scaled with the art's units. Each frame of a thread keeps its own, and a
key that is missing or can't be read leaves that option as it was. A
first baseline the frame keeps is no longer replaced by the fixed one
that matches the file's first line.

AreaOptions gets row_gutter (rowGutter, left out while unset), which
layout spaces rows by; text.areaOptions takes and reports rowGutter, a
gutter given alone sets both, and the Area Type Options dialog shows
Row Gutter.
2026-11-02 12:04:07 +07:00
dotCooCoo 79d5b5a0bf Text wrap: test a frame a wrap object covers and a 10,000-anchor wrap shape
Area type whose frame a wrap object covers sets no line and overflows.
Area type wrapped around a shape of 10,000 anchors sets its lines beside
the shape.
2026-11-02 12:04:05 +07:00
dotCooCoo 5716a996ab Type: Touch Type moves a character rotated near 90 degrees across its line
Baseline shift now moves a character in the line's frame, outside
Character Rotation, so a positive shift moves a character up from its
line at any rotation, and the character turns about its shifted pen
position. The Touch Type tool splits a drag into its part along the line
(kerning) and its part up from the line (baseline shift) at every
rotation; before, within about 6 degrees of a quarter turn it dropped
the cross-line part.

Characters that already combine a rotation with a baseline shift are
drawn in a new position. Their stored values do not change.

- text: glyph transform order, PositionedGlyph::pivot (the turning
  point), tab leaders in the same order
- tools: Touch Type splits drags against the line's up axis and measures
  rotate-handle turns about the shifted pen position
- engine: text.touchType description; dy is up from the line
- docs: mcp.md Touch Type paragraph, target-app-parity.md progress line
2026-11-01 11:08:57 +07:00
dotCooCoo 427bce12b0 Character: Font Size can measure the cap height, x-height or ICF box
Squashed from #5026 onto main.
2026-11-01 11:08:55 +07:00
dotCooCoo ece78f052f Type: Standard Vertical Roman Alignment stands half-width characters upright in vertical type
Character panel menu > Standard Vertical Roman Alignment, with Show East
Asian Options, is now a check item. It sets a new character attribute,
`standardVerticalRoman` (text.setFormat, text.setRangeStyle), off by
default and saved only when on. In vertical type the marked Latin
letters, digits and other characters that would lie on their side stand
upright one below the other, each in its upright cell. Spaces keep their
width and tate-chu-yoko blocks stay across the column. Horizontal type
keeps the mark and does not change. A combining mark shaped as its own
glyph turns with its letter, in Latin and CJK upright type alike.

Character Style Options labels the Character Alignment row "Character
Alignment" and gives Standard Vertical Roman Alignment its own checkbox.
Reset Panel turns the attribute off. PDF and SVG export place the glyphs
from the layout and need no change.
2026-11-01 08:32:55 +07:00
VladimirCericandClaude Opus 5.5 c492d524c5 Languages: Serbian (Cyrillic, Latin) and Croatian, with their quote marks
Document Setup and Character › Language list Serbian: Cyrillic (sr-Cyrl),
Serbian: Latin (sr-Latn) and Croatian (hr). Text tagged Serbian is shaped
in it (#4940, #4959), so fonts draw their Serbian forms, the italic б,
г, д, п, т. Serbian quotes follow the Pravopis (Matica srpska 2010,
т. 168) and CLDR: „…” and ’…’; Croatian per CLDR: „…“ and ‚…‘.
Illustrator lists Croatian but not Serbian.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011wCJ9DkszhZKxYL3LgcSfZ
2026-11-01 07:38:03 +07:00
bflatastic 7d8f1d4e06 Fix #4978: Area Type Options › Text Flow by rows or by columns 2026-11-01 06:11:11 +07:00
bflatastic b8365d6197 Fix #4942: native Indic digits in the Digits menu 2026-11-01 03:36:40 +07:00
bflatastic a85487ad39 Fix #4940: text is shaped in its language
Characters get a language (CharStyle::language, a BCP 47 tag of one of
Document Setup's languages; none for the default, English: USA, saved
only when set). The shaper sets it on the HarfRust buffer, so fonts use
their language forms (OpenType locl): Turkish keeps fi apart and the dot
on its i. Runs in different languages are shaped apart. New type takes
the document's language.
2026-11-01 01:39:11 +07:00
bflatastic 2f1404af22 Optical kerning: shaped advances are read with get() 2026-11-01 01:22:04 +07:00
dotCooCoo 9896f633da Type: Kerning has an Optical option that spaces characters by their shapes
Squashed from #4825 onto main.
2026-11-01 01:22:04 +07:00
Don Omondi 1679318034 Type: lam-alef highlight follow-up: optional features, all marks, exact ligature test (#394)
Highlight Alternate Glyphs no longer drops a lam-alef cluster's glyphs
outright: the ligature is clear when required shaping, or shaping with
liga left on (older fonts), gives it, so an optional feature such as
salt that changes it is highlighted again. is_lam_alef takes any
combining mark by Unicode general category (Arabic Extended-A/B/C
included) instead of a partial list. The test font maps the fatha to a
mark and skips marks in its ligature, so the mark-spanning test checks
the exact ligature glyph and cluster; it gains a salt lookup and test.

Also a one-line equivalent nonminimal_bool repair in pathops'
pathtools that strict Clippy needs on main.
2026-10-31 19:43:17 +07:00
aiongg 8ae1f7dae6 docs: tidy agent, contributor and asset docs 2026-10-31 04:17:23 +00:00
Don Omondi c1971284ce Type: required lam-alef is not an alternate in fonts that put it in liga (#394)
Highlight Alternate Glyphs compares each glyph with required shaping
alone, which turns liga and calt off. Older Arabic fonts (such as the
legacy Arial of the Microsoft core fonts) put the mandatory lam-alef
ligature in liga instead of rlig, so every lam-alef was highlighted.
A lam + alef cluster (any alef form, marks allowed) is now never an
alternate candidate, whatever feature the font uses.

Adds a test font built in code (lam-alef under liga or rlig) and
host-independent regressions. Also two equivalent one-line repairs
strict Clippy needs on main: a nonminimal_bool in the Path Precision
Tools inspect check and is_none() in a gradient panel test.
2026-10-31 02:52:05 +07:00
bflatastic 513b02233f Align: Align to Glyph Bounds for point and area type (#4231) 2026-10-30 02:01:58 +07:00
bflatastic 084f4f3240 Text: a line ending at the paragraph's start can't underflow 2026-10-29 20:36:07 +07:00
Taha-Mahmoodi 7511f84d5d Layout: end manual tate-chu-yoko at soft return, and use separator metrics for empty continuation line 2026-10-29 20:36:05 +07:00
Taha-Mahmoodi b6df1ef0b1 Type: handle soft return in no-break runs, event modifiers, trailing breaks, and tabs 2026-10-29 20:36:05 +07:00
Taha-Mahmoodi d89031848c Fix #2754: Shift+Enter inserts a soft return (forced line break)
In typography and Illustrator, Shift+Enter inserts a soft return (forced
line break) rather than ending the paragraph. Text wraps to the next line
without applying paragraph-level spacing (space before/after, first-line
indents), list continuation lines keep their parent item without repeating
markers, and justified text does not stretch lines ending with a soft return.

- Forward active modifier keys for Enter in ui-egui shortcuts so the tool
  detects Shift+Enter.
- Type tool inserts U+2028 (LINE SEPARATOR) on Shift+Enter.
- Text shaping and layout treat U+2028 as an invisible zero-advance control
  character, breaking the line in point and area type.
- Paragraph spacing and list markers apply once per paragraph as intended.
2026-10-29 20:36:05 +07:00
bflatastic e0c92a4d90 Keep a letter and its marks in one font when falling back (#4491) 2026-10-29 16:27:18 +07:00
NetterSilverandClaude Haiku 5.5 520f390c9c Map hyphenation exception break points to the original word's chars
Found while testing crates/text/src/hyphen.rs:74-90 (parse_exception)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 14:36:33 +07:00
dotCooCoo bbf01223cb Snap to Glyph: the x-height guide stays on the glyphs' x-height
Character Rotation turned a glyph's baseline shift and scaling with the glyph, and the Skew path effect slants a glyph's height away from the path's normal, so the x-height guide moved off the glyphs. Each positioned glyph now carries the transform that removes its Character Rotation (PositionedGlyph::unturned), and the guide goes through the glyph's x-height point placed without it, measured across the baseline. Snap to Glyph also takes Smart Guides being on in the tools, as View › Snap to Glyph already does in the engine.
2026-10-29 11:18:38 +07:00
dotCooCoo f87b8af62b Snap to Glyph: points land on glyph anchors and line up with x-height, character widths and angles
With View › Snap to Glyph and Smart Guides on, a point drawn near a single
line of live type now also lands on the anchor points of its glyphs and lines
up with its x-height (raised or lowered by Baseline Shift) and with the edges
of each character's advance width along the baseline (proximity guides). In
rotated type the baseline, x-height and proximity guides run at the type's
angle, and type of one glyph also has angular guides along the glyph's slanted
straight segments; a segment that Shift keeps to its angle slides onto them.
A paragraph shows glyph bounds only, so its baselines are no longer guides.

FontFace::x_height gives a face's x-height in font units.
2026-10-29 11:18:38 +07:00
Dylan M. Taylor 86c81f21d2 Restore RTL Mojikumi condition, dropped layout comments and xtask root
- flow.rs: an opening bracket starting a wrapped line is set flush unless the paragraph is
  right to left, as before the split (it had become !vertical, so vertical text with
  LineEndHalf lost the flush and RTL paragraphs gained it). PlacementContext carries rtl.
- flow.rs, ruby.rs: put back the comments the split dropped (JLREQ, burasagari, Optical
  Margin Alignment, kashidas, ruby phases).
- xtask root(): the parent directory, not .../xtask/..
2026-10-28 17:20:12 -04:00