Commit Graph
529 Commits
Author SHA1 Message Date
BFlat f9efd3ca0f Merge pull request #7983 from dotCooCoo/feat/font-menu-show-similar
Type: the font menu's Show Similar Fonts lists the families that look like a family first
2026-11-16 10:36:06 +07:00
BFlat 9a42e43640 Merge pull request #7915 from dotCooCoo/feat/glyphs-alternates-popup
Glyphs: a cell's corner triangle opens a pop-up of its glyph's alternates
2026-11-16 09:30:57 +07:00
dotCooCoo af67af91f6 Type: Show Similar Fonts reads the loaded faces once for the whole list
similar_families looked up each listed family's traits on its own, and
each look scanned every loaded face, so ordering the font menu took time
in the square of the families loaded. It now gathers the loaded faces'
traits in one pass and reads the scan's catalog once, and family_traits
uses the same helpers, so both give the same traits.
2026-11-15 17:24:30 -08:00
BFlat 5cb5a1895c Merge pull request #7869 from dotCooCoo/feat/kurikaeshi-moji-shori
Paragraph: Kurikaeshi Moji Shori draws a repeat mark that starts a line as the character it repeats
2026-11-16 08:12:54 +07:00
dotCooCoo 3d5a8afdbb Merge main into feat/font-menu-show-similar 2026-11-15 16:48:53 -08:00
BFlat 3e615f7c67 Merge pull request #7972 from dotCooCoo/feat/glyphs-show-opentype-categories
Glyphs: the Show menu lists the font's OpenType glyph categories
2026-11-16 06:56:16 +07:00
dotCooCoo 6c5229c851 Merge main into feat/kurikaeshi-moji-shori 2026-11-15 13:43:06 -08:00
dotCooCoo c26c1f3efd Type: the font menu's Show Similar Fonts lists the families that look like a family first
A ≈ button on a family's row in the font menus orders the listed families by
how alike they look to it: that family first, then the families that set the
same script (Japanese, Thai or neither), then the others, each group nearest
first. The Recent Fonts section is left out while the list is ordered this
way. A ≈ chip under the filters names the family and clears the order, with
that family still highlighted; closing the menu clears it too.

The measure is VectorCraft's own. Each face records its OS/2 PANOSE digits,
weight and width classes, x-height, cap height and average character width,
and its post italic angle; a named instance of a variable font takes its wght
and slnt settings. The system font scan reads the head table and the post
table's header besides the tables it read before, so installed families are
compared by the same numbers without loading them. A family is compared by its
face nearest an upright Regular, a number either face does not give is left
out, and a family of another kind counts as further away.

text.similarFonts {family, limit?} returns the same order, with errors for a
missing or non-string family, a family that is not available or not listed in
the font menus, and a limit that is not a whole number from 1 to 100000.
2026-11-15 13:31:36 -08:00
dotCooCoo 0a6343201f Tests: the repeat mark test font maps the combining voicing mark
The test font mapped ゝ, ゞ, ヽ and ヾ but not U+3099, so the cluster
ゝ U+3099 went to the first fallback face that has both characters.
Built with craft-fonts, that is a Japanese face, which drew the voiced
mark with its own glyph, and
kurikaeshi_moji_shori_draws_a_decomposed_voiced_mark_voiced failed.
The font now maps U+3099, so the cluster is shaped in the test font
with or without craft-fonts.
2026-11-15 13:30:02 -08:00
dotCooCoo 1c95aa2b65 Glyphs: the Show menu lists the font's OpenType glyph categories
After Alternates for Current Selection, the Glyphs panel's Show menu
and panel menu list the categories the browsed font's GSUB features
give glyphs to: Ligatures, Swash, Stylistic Alternates, each stylistic
set by the font's name for it (else Set N), Small Caps, Ornaments,
Fractions and Figures. Choosing one shows that category's glyphs, the
characters first and then the glyphs no character maps. A font without
the chosen category shows Entire Font.

- text: FontFace::glyph_categories reads the single, alternate,
  multiple and ligature substitutions of each category's features,
  once per face, leaving out a substitution an earlier subtable of
  its lookup shadows, within a total glyph budget.
- engine: text.glyphCategories {family, style?} lists them.
- ui-egui: the Show menu and panel menu entries, with Ligatures,
  Ornaments and Figures rows in every catalog.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-15 12:56:14 -08:00
dotCooCoo ad275a9291 Merge main into feat/kurikaeshi-moji-shori 2026-11-15 11:59:36 -08:00
dotCooCoo 7ced0d5c9a Type: Tsume applies in vertical type and to color glyphs
Tsume no longer stops at horizontal type. In vertical type an upright
character loses its share of the blank space above and below its ink,
inside its cell down the column (the font's vertical metrics, else at
least one em, with the Proportional Metrics change), in point type and
on a path. A character lying on its side is measured along its own
width, and the characters of a tate-chu-yoko block close up across the
column while the block keeps its one em.

Tsume now measures what a glyph paints: its COLR or SVG art, else its
color bitmap, else its outline, so a color glyph is no longer measured
by the outline its art replaces.

Docs: docs/mcp.md, docs/target-app-parity.md, text.setRangeStyle and
text.setFormat params.
2026-11-15 10:56:09 -08:00
dotCooCoo 3607c70efe Glyphs: a cell's corner triangle opens a pop-up of its glyph's alternates
A Glyphs panel cell whose glyph has alternates shows a small triangle in
its lower right corner. A click on it opens a pop-up of that glyph and
its alternates in the font's order. Picking one inserts the character at
the Type tool's caret drawn with that glyph, or draws the selected
character with it, in one undo step; the cell's own glyph inserts the
character as a double-click does. In Entire Font a glyph no character
maps has the triangle too, and a pick goes on the selected character as
a double-click on that glyph's cell does.

A pick is tried on a copy of the document first, so one the character
cannot be drawn with (All Caps, for example) changes nothing and the
status says why. A Select All over a threaded story is replaced as
typing replaces it. The triangle's size and the pop-up's eight columns
and six rows are VectorCraft's own.
2026-11-15 10:25:04 -08:00
dotCooCoo 3ca38f2237 Paragraph: Kurikaeshi Moji Shori draws ゝ or ヽ with a combining voicing mark as voiced
ゝ or ヽ followed by U+3099, which a font draws as one glyph, is now drawn
at a line start as ゞ or ヾ would be, instead of as the plain kana. A mark
that shares its cluster with other glyphs, or with any other combining
character, keeps its own glyphs.
2026-11-15 10:01:43 -08:00
dotCooCoo fcaed952fb Paragraph: Kurikaeshi Moji Shori draws a threaded type-on-path frame's first repeat mark
A frame of type on a path whose first paragraph continues from the frame
before now draws a repeat mark at its start as the character before it in
the frames before, as area and point type do. The mark keeps its advance,
so the glyphs stay where they were, and live SVG text writes the character
drawn.
2026-11-15 09:50:38 -08:00
dotCooCoo a5b84d8e2a Paragraph: Kurikaeshi Moji Shori keeps one record per mark when area type flows again
Vertically aligned area type in a frame that is not a rectangle flows its
text again until it settles, and each pass added the line-start repeat
marks to the layout's records once more, so SVG export could look up the
wrong character. Each pass now starts from empty records, and an undone
pass restores the ones before it.
2026-11-15 09:38:15 -08:00
dotCooCoo 74f139062b Paragraph: Kurikaeshi Moji Shori scans a paragraph once while laying it out
Each line that started with a repeat mark scanned the paragraph's text from
its start for the character the mark stands for, so a paragraph with marks
at the start of many lines took quadratic time to lay out. The scan now
goes on from the line before.
2026-11-15 09:31:23 -08:00
dotCooCoo f9a2abad18 Paragraph: Kurikaeshi Moji Shori draws a line-start repeat mark as the character it repeats
Paragraph panel menu > Kurikaeshi Moji Shori (text.setFormat
{kurikaeshiMojiShori}) is a paragraph attribute, off by default, saved
only when on and carried by paragraph styles. On, a repeat mark (々, ゝ,
ゞ, ヽ, ヾ) that starts a line of point or area type is drawn as the
character it repeats, with the mark's width, and the text keeps the
mark. Threaded type looks back into the frames before when a paragraph
continues. Live SVG text writes the drawn character and places the
text after it.
2026-11-15 07:02:27 -08:00
dotCooCoo f90ac94876 Merge main into feat/diacritic-position 2026-11-15 06:18:24 -08:00
BFlat ea3f81d9c3 Merge pull request #7518 from Taha-Mahmoodi/feat/indic-composers
feat(text): Middle Eastern & South Asian and Standard composers per paragraph (#4935)
2026-11-15 20:45:02 +07:00
BFlat 7350a7a703 Merge pull request #7810 from dotCooCoo/fix/burasagari-and-push-in-on-a-tabbed-right-to-left
Type: a burasagari mark hangs only where it is drawn at the line's right end
2026-11-15 17:30:12 +07:00
Taha-Mahmoodi d4ac2782c0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/target-app-parity.md
2026-11-15 14:12:59 +04:30
BFlat e5f15de4d6 Merge pull request #7770 from dotCooCoo/feat/composite-custom-character-sets
Type: composite fonts take custom character sets
2026-11-15 15:45:12 +07:00
dotCooCoo 7c1eb52111 Merge main into feat/diacritic-position 2026-11-14 22:55:52 -08:00
dotCooCoo 0384726c7a Type: Adjust Horizontal and Vertical Diacritic Position move marks off their letters
The Character panel shows Adjust Horizontal and Adjust Vertical Diacritic
Position with the Middle Eastern options. text.setFormat and
text.setRangeStyle take diacriticHorizontal and diacriticVertical, in
thousandths of an em from -1000 to 1000. Positive values move the
characters' mark glyphs (GDEF class 3) right and up, and the letters keep
their places. An Arabic harakat or a Hebrew point styled apart from its
letter takes its own values without splitting the shaping cluster.

Character styles and Character Style Options carry both values. They are
saved only when set, and SVG export writes such type as outlines.

Docs: docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md.
2026-11-14 22:54:10 -08:00
Taha-Mahmoodi 18095f4103 Merge remote-tracking branch 'origin/main' into feat/indic-composers
# Conflicts:
#	crates/engine/src/cmd/panelcmds.rs
#	crates/text/src/shape.rs
#	crates/ui-egui/src/i18n/bg.tsv
#	crates/ui-egui/src/i18n/bs.tsv
#	crates/ui-egui/src/i18n/ca.tsv
#	crates/ui-egui/src/i18n/da.tsv
#	crates/ui-egui/src/i18n/el.tsv
#	crates/ui-egui/src/i18n/es.tsv
#	crates/ui-egui/src/i18n/fi.tsv
#	crates/ui-egui/src/i18n/fr.tsv
#	crates/ui-egui/src/i18n/hu.tsv
#	crates/ui-egui/src/i18n/id.tsv
#	crates/ui-egui/src/i18n/ja.tsv
#	crates/ui-egui/src/i18n/ka.tsv
#	crates/ui-egui/src/i18n/ko.tsv
#	crates/ui-egui/src/i18n/nl.tsv
#	crates/ui-egui/src/i18n/ru.tsv
#	crates/ui-egui/src/i18n/tr.tsv
#	crates/ui-egui/src/i18n/vi.tsv
#	docs/gaps.md
#	docs/mcp.md
#	docs/target-app-parity.md
#	docs/type-parity.md
2026-11-15 11:13:18 +04:30
Taha-Mahmoodi 96e7078ec8 fix(text): format controls draw no ink; revision rows in Revision history (review) 2026-11-15 11:11:29 +04:30
dotCooCoo 18fe65acd6 Type: composite fonts take custom character sets
Type > Composite Fonts... has Custom: named character sets, each setting
the characters it lists in its own font, style, size, baseline and
scales ahead of their class. The later of two sets that list a character
sets it. Characters are added by Direct Entry or by Unicode code and
deleted one at a time, and the parts table scrolls when it grows.

- type.compositeFonts.set takes `custom`; part keys left out take the
  Kanji part's values. Sets are saved with the document and in
  .vccomposite files, and Export refuses a file over 4 MB.
- VectorCraft's own limits: 64 sets per font, 8,192 characters per set,
  each character once per set, up to U+FFFF and no control characters.
- The font database caches each font's character lookup.

Docs: docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md.
2026-11-14 22:16:08 -08:00
dotCooCoo b33e62a8fe Type: a burasagari mark hangs where it is drawn at the line's right end
On a tabbed line measured as drawn, a full stop or comma now hangs when
it is last in the visual order of the line's levels (UAX #9 L2, with
each tab and the spaces before it at the paragraph's level), whatever
its own level. A mark at level 2, or a lone right-to-left mark after
left-to-right text, hangs again; a mark inside a right-to-left run
still ends the line at an earlier break.

A mark that No Break or Bunri-Kinshi keeps with the characters after
it no longer ends the line as if it hung: the line would end with
those characters, which are drawn inside it, so it ends at an earlier
break.
2026-11-14 21:40:05 -08:00
dotCooCoo 4f1e4e94bc Merge main into fix/burasagari-and-push-in-on-a-tabbed-right-to-left 2026-11-14 20:40:12 -08:00
BFlat 511f36ed4c Merge pull request #7721 from dotCooCoo/fix/glyph-forms-review
Type: glyph forms and width forms follow the OpenType rules
2026-11-15 11:37:33 +07:00
BFlat 26878d3d0e Merge pull request #7715 from dotCooCoo/fix/svg-open-path-type-before-start
Type on a path: type on an open path can start before the path
2026-11-15 10:46:42 +07:00
dotCooCoo 31562c2786 Merge main into fix/burasagari-and-push-in-on-a-tabbed-right-to-left 2026-11-14 19:25:00 -08:00
dotCooCoo e9cd607aae Merge main into fix/glyph-forms-review 2026-11-14 19:20:09 -08:00
BFlat 563f075764 Merge pull request #7707 from dotCooCoo/feat/opentype-hv-style-roman-italics
OpenType panel: H or V Style and Roman Italics set kana and Latin forms
2026-11-15 09:46:29 +07:00
dotCooCoo d43d3e84df Type: burasagari keeps right-to-left and tabbed mixed lines inside the frame
A right-to-left paragraph draws a comma or full stop inside its line,
but the breaker still kept an overflowing mark on the line as if it
hung, so the line was drawn past the frame. The breaker now ends such a
line at a break where it fits with the mark.

In a left-to-right line with right-to-left text and a tab, the breaker
hung an overflowing mark without measuring the line as drawn. It now
hangs the mark only when the mark is drawn at the line's right end and
the line before it fits as drawn; otherwise the line ends at the latest
legal break that fits as drawn.
2026-11-14 18:27:58 -08:00
dotCooCoo 0f8b20c489 Type: glyph forms and width forms follow the OpenType rules
- A form other than the default, set with text.setRangeStyle or
  text.setFormat, takes away the characters' glyph choice, which would
  otherwise keep drawing its own glyph. "default" keeps it.
- With a width form (fwid, hwid, twid, qwid), shaping leaves out palt and
  turns kern and apkn off, and SVG output writes font-kerning: none and no
  palt, as the OpenType feature list asks. proportionalMetrics and kerning
  keep their values.
- The Glyphs panel menu counts a width form as available when a face has
  the feature in GSUB or GPOS.
- At a caret, the menu's check marks and its no-op check read all the
  text of the object, which is what the command formats. Choosing the
  current form again is not skipped when a character has a glyph choice.
2026-11-14 16:39:01 -08:00
dotCooCoo 094971e3ac Type on a path: type on an open path can start before the path
Type on an open path can now start before the path's start: its start
is stored below 0, the span runs from there, and the characters whose
middle falls before the path's start are not drawn, as SVG 2 lays out
text on a path (https://www.w3.org/TR/SVG2/text.html#TextLayoutPath).
The text keeps every character, and the start bracket stays at the
path's start. Past the path's end, text that does not fit is overflow,
as for other type on a path. Type that starts on the path draws every
glyph as before.

- SVG import keeps a <textPath> start before an open path's start
  (text-anchor end or middle, or a negative startOffset) instead of
  starting the text at the path's start, which drew every character.
- SVG export writes it as a negative startOffset.
- PDF export writes only the characters drawn on the path.
- The legacy .ai and .ai editing data writers write the type from the
  path's start with the type attributes warning.
- type.pathOptions takes a start below 0 for type on an open path; on a
  closed path it is the path's start, as before. A flip starts the type
  at its start bracket. Dragging the center bracket slides it from where
  it starts, and no further before the path.
- A click at the path's start places the caret by the first drawn
  character, and the caret in the hidden characters stands at the
  path's start. The highlight of substituted fonts and glyphs leaves
  them out.
- Release Type on a Path keeps the first drawn glyph where it was
  drawn, with the hidden characters before it.
- The Touch Type tool shows no box for a hidden character, and
  text.touchType returns an error for one. A character with a drawn
  glyph is changed by that glyph.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-14 15:44:12 -08:00
dotCooCoo 1d64e0f9ef Type: the harakat Tsume test also compares advances
With Noto Sans Arabic the fatha's ink reaches past the first letter's
left edge, so that letter's Tsume only narrows its advance and moves no
glyph. The test compared glyph positions alone and found no change.
It now compares each glyph's position and advance.
2026-11-14 15:39:28 -08:00
dotCooCoo d91e6a8565 Merge main into feat/opentype-hv-style-roman-italics 2026-11-14 15:24:42 -08:00
dotCooCoo 09ec24ee28 Merge main into fix/optical-keeps-tsume 2026-11-14 15:22:48 -08:00
dotCooCoo 0431809643 OpenType panel: H or V Style and Roman Italics set kana and Latin forms
With Show East Asian Options on, the OpenType panel menu has H or V
Style and Roman Italics. H or V Style is the character feature tag
`hkna`: kana take the forms the font draws for horizontal type, and in
vertical type the shaper applies `vkna` in its place. Roman Italics is
`ital`, the font's italic half-width alphanumerics. Both are on or off
only (`hkna=2` is refused), set through `features` and
`featureChanges`, cleared by Reset OpenType Features, and are switches
in Character Style Options > OpenType Features.

Docs: docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md.
2026-11-14 15:22:36 -08:00
BFlat 4e42e2bbb0 Merge pull request #7681 from dotCooCoo/feat/east-asian-glyph-forms
Type: Glyphs panel menu draws the selected characters in an East Asian glyph form
2026-11-15 06:17:55 +07:00
BFlat 6f5bf3dd6d Merge pull request #7679 from dotCooCoo/fix/colr-empty-fill-keeps-clip
Text: a COLR fill that paints nothing keeps the clip around the glyph after it
2026-11-15 06:16:16 +07:00
BFlat 66c73c4b91 Merge pull request #7685 from dotCooCoo/fix/warichu-line-height-block-lines
Type: a warichu line holds the ascent and descent of its outer block lines
2026-11-15 06:15:52 +07:00
BFlat ada1c9263a Merge pull request #7555 from dotCooCoo/fix/tabbed-rtl-negative-tracking-break-bound
Type: a tabbed right-to-left line with negative tracking stops reading after a bounded number of breaks
2026-11-15 05:28:48 +07:00
dotCooCoo f1cffdd8c0 Type: a warichu line holds the ascent and descent of its outer block lines
A block's line took the tallest ascent and deepest descent of its
characters, or the height of the stack's em boxes, whichever was larger.
The top block line's characters reach above the stack by their ascent
past the em box, and the bottom line's below it by their descent, so with
a wide Line Gap the line was too short for them. The line's ascent and
descent now also take in each character's reach from its own block line's
baseline.
2026-11-14 13:46:56 -08:00
dotCooCoo 2212af9653 Text: a COLR fill that paints nothing keeps the clip around the glyph after it
A fill in a glyph's clip marked the clip as filled before the fill was
added. When the fill painted nothing (a palette index past the palette,
or a radial gradient that draws no circle), the next glyph painted in
the same clip became the clip's only child, and closing the clip kept
that glyph on its own, so it drew outside the clip.

The clip is now marked filled only when the fill adds the clip's first
child, and a fill that adds nothing leaves the mark as it was.
2026-11-14 13:38:31 -08:00
dotCooCoo ee5e2db9c4 Type: Optical kerning keeps the space Tsume takes out
Tsume narrows a cluster before Optical kerning measures its pairs, so
Optical measured the narrowed gap and gave part of the space back.
Optical now measures each pair as it would be without the Tsume, as it
already does for Insert Aki, and the Tsume stays on top. Tsume records
what it took on the glyph for this.
2026-11-14 13:36:55 -08:00
dotCooCoo f4a5d65f6b Type: Glyphs panel menu draws the selected characters in an East Asian glyph form
With Show East Asian Options on, the Glyphs panel menu lists Traditional
Forms, Expert Forms, JIS 04, JIS 90, JIS 78 and JIS 83 Forms, Monospaced
Full-Width, Half-Width, Third-Width and Quarter-Width Forms, and Revert
To Default Forms. Each form draws the selected characters with the
font's OpenType feature for it (trad, expt, jp04, jp90, jp78, jp83,
fwid, hwid, twid or qwid). A form is checked when every selected
character has it and disabled when none of the faces that draw the
selected text, fallback faces included, has the feature.

The form is a new character attribute, glyphForm, one form at a time
(text.setFormat, text.setRangeStyle). It is saved only when set,
character styles carry it, and runs that differ only in their form
shape as one piece of text. SVG writes it in font-feature-settings;
PDF draws the glyphs from the layout.
2026-11-14 13:29:30 -08:00