Commit Graph
718 Commits
Author SHA1 Message Date
.CooCoo 95dd368c2c Merge pull request #10188 from dotCooCoo/fix/craft-fonts-pin-main
CI: move the craft-fonts pin to craft-fonts main in every workflow, so builds embed the tab-title face
2026-12-01 22:27:41 -08:00
.CooCoo 40b3f26d62 Merge pull request #10535 from dotCooCoo/fix/sysfonts-menu-family-held-scan
Tests: the menu family list test holds the font scan with a lister
2026-12-01 22:12:54 -08:00
.CooCoo 22bc29d69d Merge pull request #10460 from dotCooCoo/fix/test-lint-mirror-false-alarms
xtask: test-lint mirror leaves out entry reads, never-run follows #[path] modules
2026-12-01 20:19:50 -08:00
dotCooCoo 1957da7178 Tests: the menu family list test holds the font scan with a lister
the_menu_family_list_now_does_not_wait_for_the_scan held the background
font scan with a named pipe named like a font. The font catalog now
skips files that are not regular files, so the scan never waited on the
pipe: it read the small test folder and could finish before the test
called installed_fonts_ready and menu_family_list_now. On a busy CI
runner the test then saw the installed fonts and failed with "before the
scan ends, only the fonts already loaded".

The test now builds its database with a test-only lister that the scan
calls before it reads the folder. The lister waits until the test drops
a channel sender after the two calls return, and gives up after 10 s so
that a list that waits for the scan fails the test instead of hanging
it. The pipe, the release thread and the Unix-only gate are removed.
2026-12-01 19:54:21 -08:00
dotCooCoo 6e6a9a6d2f Merge main into fix/craft-fonts-pin-main 2026-12-01 19:29:33 -08:00
dotCooCoo 5071f17319 Tests: skip the Hebrew mark cluster test when no font covers Hebrew
hebrew_marks_stay_with_base_clusters asserts exact glyph start offsets,
which depend on the face that shapes the word. It now skips, as the
sibling font-dependent tests do, when no installed face covers shin,
lamed, vav and final mem.
2026-12-01 17:53:19 -08:00
dotCooCoo 771e73d405 Tests: Hebrew mark clusters must cover the whole word
hebrew_marks_stay_with_base_clusters now calls assert_source_coverage, so
glyphs that start at the four letters but leave the marks out of their
source ranges fail the test.
2026-12-01 17:47:59 -08:00
dotCooCoo beeeacafe5 Tests: text and doc tests check what the code returns, not only that it is there
Tests in vectorcraft-text and vectorcraft-doc that could pass on an empty
result, or that only checked a result exists, now assert the values:

- Blend: gradient steps assert their stop count before checking each
  stop's swatch, tint and plates; the odd dash blended to solid asserts
  the whole pattern; a copied step asserts its members.
- Symbols: limiting depth keeps every symbol; a stroke override on type
  keeps the run it styles.
- File fonts: an extreme descent clamps to the lowest table value and
  the Windows descent still fits.
- Invert wrap on a tangled shape asserts the line still meets it.
- Bidi, ligature carets, Thai and whitespace fallback: the glyph and
  line counts are asserted, Hebrew points stay in their letters'
  clusters, and every character of an isolate test has a glyph.
- Glyph categories, trace views, compound shape modes and digit
  systems check written-out ids instead of a round trip over every
  value.

Removed joins_on_a_circle_are_measured, which printed measurements and
asserted nothing, and chord_placement_leaves_the_join_gap_above_the_baseline,
which checked arithmetic done in the test itself;
joined_glyphs_meet_on_a_curved_path covers joined type on a curve.
2026-12-01 17:25:24 -08:00
dotCooCoo a61a9ba254 Merge main into fix/test-lint-mirror-false-alarms 2026-12-01 16:17:26 -08:00
.CooCoo 4596f1a8be Merge pull request #10374 from dotCooCoo/fix/swallowed-regression-guards
Tests: guards check the environment, not the output under test
2026-12-01 14:10:23 -08:00
dotCooCoo eca4eae37d Merge main into fix/test-lint-mirror-false-alarms 2026-12-01 07:13:57 -08:00
.CooCoo dd144f7cab Merge pull request #10440 from dotCooCoo/fix/test-tolerances-text-color
Tests: tighten loose bounds in color and text tests
2026-12-01 06:50:03 -08:00
dotCooCoo b2e8b5637e Merge main into chore/never-run-test-allows 2026-12-01 02:55:37 -08:00
dotCooCoo 6ea1132e5c Tests: tighten loose bounds in color and text tests
Five assertions accepted wrong results:

- Freeform: a point split half way along a Catmull-Rom segment must be
  at x = 43.75, not anywhere between the two ends.
- Diamond gradient pixels: the center is exactly white and the corners
  exactly black, instead of a bound that accepted white scaled to 220.
- Ruby: the default reading is half the base size (ratio 0.5), where
  the old bound accepted 70%.
- Caret Up/Down: the caret lands on the stop nearest the column, where
  the old 12 pt tolerance accepted a neighboring stop.
- Hyphenation defaults: a frozen hash of line breaks is replaced with
  explicit breaks ("The lan-" / "guage", "The gar-" / "den") and hyphen
  flags for both composers, ragged and justified.

Each new assertion fails when the behavior it checks is broken.
2026-12-01 02:27:00 -08:00
dotCooCoo 010367e39e Tests: allow the 26 Windows and macOS tests that CI never runs
Each test that a cfg limits to Windows, macOS or a case-insensitive file
system gets a `test-lint: allow never-run` line naming its platform, so
`cargo xtask test-lint` no longer reports them. The tests are unchanged
and still run on their own platform.
2026-12-01 01:46:09 -08:00
dotCooCoo c9d9b75f76 Tests: the held font scan test no longer hangs when its pipe is released early
the_menu_family_list_now_does_not_wait_for_the_scan holds the font scan
at a named pipe and released it with one blocking open for writing. That
open waits for any reader and lets go only the readers already waiting.
When the scan reached the pipe after the release, or ran on the test's
own thread because its background thread did not start, nothing opened
the pipe again and the test waited until the job timed out (a gate shard
on pull request 10368 ran for over two hours).

The release thread now opens the pipe for reading and writing, which
does not wait for a reader, and repeats that until the scan has ended.
The thread is joined after the list that waits for the scan.
2026-12-01 01:30:45 -08:00
dotCooCoo 1dbbf87436 Tests: guards check the environment, not the output under test
Several tests returned early when the code under test gave back nothing,
so the regression they guard against passed. Each of those guards now
checks only what the host provides (an installed face, the bundled
fonts), and the output itself is asserted:

- PDF live text: the lam-alef face is no longer picked by whether its
  type imports (#6072); Insert Kashidas asserts the kashida and the
  imported type.
- Effects and Expand Appearance on type assert the outlines and the
  drawn type when the default face is installed.
- The OpenType panel's Stylistic Sets test asserts sets with the
  bundled fonts.
- Thumbnail worker tests assert that the worker starts; the memory
  peak test asserts a reading.
- The json2 test checks the interpreter's Date, replace and RegExp on
  every run, before looking for json2.js.
- Devanagari arrow keys and the Arabic narrow-area wrap assert the
  layout they set up.
2026-11-30 21:56:24 -08:00
dotCooCoo c61c271b74 CI: move the craft-fonts pin to craft-fonts main in every workflow
The CI, FreeBSD, nightly, macOS nightly and release workflows pinned
craft-fonts b076417, which has no fonts/latin-manifest.txt, so every
build warned that it could not embed the tab-title face. They now pin
craft-fonts main at 16bbfc3, which adds Noto Sans Condensed SemiBold
(storytold/craft-fonts#72), so builds from these workflows draw document
tab titles in it. The pin also brings Noto Sans Lao, Noto Sans for eight
Indian scripts (Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu,
Kannada and Malayalam) and the Latin catalog.

With the new faces a build loads 135 faces instead of 54, and Retype
compares the first 96 first. Two faults showed:

- Retype: near matching fits a shape with at most the 256 glyphs closest
  to it in proportion over every face. The dots and periods of the new
  faces, drawn alike in each family and each named weight, took all 256
  places, so a simplified Source Sans 3 period after "no" matched no
  glyph of Source Sans 3 and was left as an outline. A shape that near
  matches no glyph of the font of the line before it is now also
  compared with that font's own 256 closest glyphs, and joins the line
  when one fits. RetypeIndex::near_matches_in does that lookup.
- Tests: six Retype tests added their test font to the global font
  database and expected Retype to compare it, which it did only while
  fewer than 96 faces were loaded before it. They now name the font
  (type.retype's fonts, or live type in the family as #6896 does for
  of_two_versions_only_the_one_the_name_gives_is_listed), and
  lines_in_family fails when the family has no match instead of reading
  another face.

all_supplied_craft_font_families_are_registered_without_system_fonts
looked up every embedded craft-fonts face in the document font database.
The tab-title face is embedded for tab titles only and the database
leaves it out (document_fonts), so the test now checks the faces
document_fonts lists.

docs/mcp.md describes the new near-match step, and docs/ui-parity.md and
docs/localization-parity.md describe the new pin.

The pin change and the version test fix follow #6896 by @newsbaba24x7.
2026-11-29 20:05:10 -08:00
dotCooCoo d2b18d1270 Text: web-fonts.txt lists only faces that craft-fonts ships
crates/text/web-fonts.txt listed 30 background faces (Cairo, Tajawal,
Almarai, IBM Plex Sans Arabic, Noto Kufi Arabic, Amiri, Alexandria,
Fustat, Reem Kufi, Aref Ruqaa and Gulzar) that craft-fonts does not
have yet; they are added by storytold/craft-fonts#11 and #13, which are
still open. Every build with CRAFT_FONTS_DIR printed "web build won't
fetch: Cairo Regular, Tajawal ExtraLight, ..." from crates/text/build.rs
and xtask/src/web_fonts.rs, and the web build fetched none of them.

The rows are removed. The startup and demand faces stay. The rows go
back in when craft-fonts #11 and #13 merge.
2026-11-29 16:50:38 -08:00
.CooCoo 378ab8525e Merge pull request #9950 from dotCooCoo/train/carry9243
Missing Fonts: a folder search finds the file of a PostScript name split into family and style (carries #9243)
2026-11-28 13:15:06 -08:00
dotCooCoo 69e8a0a392 Fonts: offer a split PostScript name's file only when installing it resolves the name
The joined-name check now matches the face's PostScript name only, as
`FontDb::canonical` does for cataloged faces, so a file that carries the
joined name only as a full name is no longer offered. A legacy family of
the wanted name now decides the result, looking for the style in the
family of each of its faces, since `canonical` does not join the name
when the legacy family resolves it.

Tests cover the full-name and legacy cases against `FontDb::resolve`,
and a collection whose faces share a legacy family in either order.
2026-11-28 09:33:49 -08:00
dotCooCoo 990c8b2d26 Fonts: test the full-name and empty-style cases of the split PostScript name search
The folder search test now also checks a file that carries the joined
name only as its full name, and that a wanted font without a style is
not offered a file through the joined name.
2026-11-28 08:37:27 -08:00
dotCooCoo b812b4a627 Merge main into train/carry9243 2026-11-28 08:11:20 -08:00
dotCooCoo 338a5c7a32 Merge main into fix/previewbounds-memo-flake 2026-11-28 05:18:26 -08:00
dotCooCoo 0753eeeb9b Merge main into fix/issue-8583 2026-11-27 22:29:29 -08:00
dotCooCoo 90749b1646 Tests: text tests count work and wait on handshakes instead of the clock
Six tests in vectorcraft-text passed or failed on how fast the machine
ran them. They now check work counts and handshakes:

- Layout speed (1,000 characters, and 10,000 under each composer):
  laying out twice the text takes at most 2.5 times the steps, and at
  most 32 steps a character. The steps are the bytes shaped, the clusters
  the single-line composer reads and the line starts the every-line
  composer weighs at each break, counted by a test-only counter.
- Many one-run paragraphs: the runs the paragraphs look through stay
  within 4 per paragraph.
- A contour-point caret on a huge composite reads no more glyphs than
  the lookup's budget, and a shape whose readings all fail tries no more
  readings than the cap.
- The font menu's quick list is read on the test thread while the font
  scan is held. A list that waited for the scan would hold the installed
  fonts, so the list's content decides the result. The 10 s timeout only
  releases a call that hangs.

Two font folder tests slept 50 ms to get past the file system's clock
tick. They now set the folder's modification time with
File::set_modified.
2026-11-27 17:10:42 -08:00
dotCooCoo 64ada8e7fc Tests: hover memo counts hold plug-ins and hyphenation steady
The Preview Bounds memo checks the fonts, the hyphenation exceptions and
the plug-in revisions on every lookup. Other engine tests change the
hyphenation exceptions and install plug-ins on other threads, so a
change between two hovers refreshed one memo slot and
a_hover_checks_the_memo_as_often_however_many_objects_are_selected
counted 5 checks instead of 4.

- set_hyphenation_exceptions takes the font gate (test_fonts::font_change),
  as composite font changes do, so steady_fonts holds it back too.
- vectorcraft_plugins::steady (feature test-steady) gates every revision
  bump in the plug-in registry and the deferred stages the same way.
- Both counting tests in previewbounds.rs hold both guards, and the
  hyphenation round-trip test holds steady_fonts through its sequence.
2026-11-27 15:23:49 -08:00
BFlat a431537d95 Merge pull request #8823 from dotCooCoo/feat/retype-installed-fonts
Retype: installed fonts that are not loaded yet are matched too
2026-11-27 05:09:16 +07:00
FredApps f182ad845b Text: an over-budget COLR glyph returns no image, raster fallback included
A sweep gradient sets unsupported without too_large, so a glyph that later passed the budget
still took the raster branch, and Pixels replayed the whole graph with no budget. Check
too_large first, as tree.finish() does. Under-budget glyphs are unchanged. Answers CodeRabbit.
2026-11-26 21:56:36 +07:00
FredApps 937e1929ae Merge main into fix/sec-text-colr-budget (main moved outline drawing into outline_uncached; it now finishes with the capped FlipPen::finish) 2026-11-26 21:56:36 +07:00
dotCooCoo bf782369fc Merge main into feat/retype-installed-fonts 2026-11-25 15:23:05 -08:00
dotCooCoo 23c310b6be Merge main into fix/issue-8583 2026-11-25 13:52:58 -08:00
dotCooCoo 43315db6b4 Tabs: document tab titles draw in the condensed face through craft-ui's tab-title role
Desktop builds call `Embed::tab_face()`, which embeds the Noto Sans
Condensed SemiBold row of the checkout's `fonts/latin-manifest.txt` with
the `tab` role. craft-ui draws semibold document tab titles in it, scaled
to the semibold face's x-height. The document font list leaves that face
out. Web builds and builds without the face draw tab titles in the
semibold face.

The craft-libs crates point at storytold/craft-libs#3545's head until it
merges.
2026-11-25 09:49:22 -08:00
dotCooCoo 1872e52203 Glyphs: a font's glyph names are read once, so the panel stops scanning the post table for every cell
FontFace::glyph_name looked each name up in the font. In a version 2.0
post table the names are one run of strings, and read-fonts walks that
run from its start for every lookup. The Glyphs panel builds the
tooltip of every visible cell in every frame, and the tooltip of a
glyph that no character maps carries its name, so each frame scanned
the table once per such cell.

glyph_name now reads every name of the face in one pass the first time
it is asked, through skrifa's name iterator, and keeps them on the face.
A new test checks the kept names against each glyph's own lookup for
every bundled face.
2026-11-25 03:24:49 -08:00
dotCooCoo 7a85e09b26 Merge main into feat/retype-installed-fonts 2026-11-24 15:21:47 -08:00
Carlo1911andClaude Sonnet 5.5 eb3b83f509 Missing Fonts: a folder search finds the file of a PostScript name split into family and style (#9242)
A document names Gilroy-Black as the family Gilroy in the style Black. WantedFonts only indexed and checked the family name, so a file whose own family is Gilroy-Black, with no style, was never offered, although FontDb::canonical finds that face by its PostScript name once it is cataloged. The joined family and style is now indexed and accepted against a face's PostScript or full name.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-24 17:28:14 -05:00
BFlat 066aaed62f Merge pull request #8814 from dotCooCoo/fix/retype-drawn-shape-font-state
Retype: no retyped line starts with a combining mark
2026-11-24 16:01:24 +07:00
BFlat 6f37bd839c VectorCraft on the craft UI framework (#8800)
VectorCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (`next`; the framework side is storytold/craft-libs#2809), as PhotoCraft's did. The app keeps its engine, document model, file formats, commands and automation; its windows, panels, bars, dialogs and canvas are now built and driven by the framework: shell, docking and panels, hosted dialogs, keyboard, focus, IME and pointer routing, and theme tokens.

About 264,000 lines of VectorCraft's own egui UI code are removed and about 154,000 added. craft-libs is pinned at bf62d509f (in `next`), the egui fork at f5025284.

Tests that drove the old UI were rewritten against the port where only their premise changed, with their assertions kept. The UI tests still failing at merge, and their follow-ups, are listed in the pull request.
2026-11-24 08:25:24 +07:00
dotCooCoo 6e713caf33 Merge main into feat/retype-installed-fonts 2026-11-22 23:39:38 -08:00
FredApps a3b0b3dec0 deps: pin all craft-libs crates to 205042e (craft-libs#778)
Rule 10: every storytold/craft-libs crate is at the same rev, now
205042e406b630cda653990649264a78fea6296b, the merge of #3136 on
craft-libs main. That rev still skips a form already on the drawing
stack (ISO 32000-2 §8.10.1) but no longer reports it as
ContentTruncated, so a 200-shape knockout-mask PDF imports completely.

Also moves the leftover per-crate pins of craft-font-catalog and
craft-web-api onto the same rev.
2026-11-23 03:59:59 +01:00
5af36bae87 Fix #4568: PDF import keeps embedded fonts for text whose family isn't installed (#4569)
* PDF import: keep embedded fonts for text whose family isn't installed

Glyphs drawn in an embedded font whose family isn't available are gathered
during import and built into one small TrueType font per family and style,
kept with the document (font/ttf blob). Text objects record the fonts and a
hash of their text: layout and rendering draw them in the kept font until the
text is edited (undo restores it) or the family is installed. Lines are
spaced against the file's own widths with per-glyph placement (#3756).

* PDF import: satisfy crate layering constraints without format dev-dep

* FileFont: negate us_win_descent in i32 to prevent overflow on extreme negative descenders

* PDF import: a kept font carries the file font's licence flags, and the docs say what that means

Review of #4569: the fsType of the file's font is copied to the font built from its glyphs (a test pins it against Embedding), so exports honour it; the docs state the limits, that the file's font program is not parsed, and that a saved file carries third-party glyphs.

* PDF import: a glyph curve far outside any glyph is left out; docs say what the limits and the font program mean

CodeRabbit on #4569: coordinates beyond 1e6 font units are refused before the curve is subdivided. The docs say the 64-font limit is what draws one type object and that the file's font program is read only for its licence flags and metrics.

* PDF import: two programs of one font keep the stricter licence flags; the docs cite their sources

CodeRabbit on #4569: embedded programs of one family and style share one built font, which kept the first program's fsType; it now takes the stricter of the two, whichever came first. The docs entry cites the Acrobat Help pages and the OpenType fsType specification.

* fmt

* PDF import: embedded fonts are on by default, with an opt-out preference

Owner decision on #4568. Preferences > File Handling > Use fonts embedded in imported PDFs (pdfImportEmbeddedFonts, on by default) and the embeddedFonts param of document.open and file.place: off, a PDF's type in a font the machine lacks is set in the fallback font with the missing-font warning, as before. One test each for on and off, one for the preference reaching the options.

* fmt after merging main

* docs: restore the status lines damaged by merges (main's line plus this PR's note)

* PDF import: set embedded_fonts through a builder method (keeps read_opened under the complexity limit)

* PDF import: move the missing-font notes out of read_opened (complexity limit after the merge)

* #4569: isolate file-font resources and reclaim live faces (UNVERIFIED)

* Preserve carried-font ownership across placement and recovery

* Fix carried-font regression test dependencies and unwind probe

* Use explicit OS2 heights in owned-font reference regression

* Keep native font regression artwork inside document layers

* fix(engine): bind file fonts when reading document profiles

* test(engine): initialize file-font leases in new image fixtures

* test: complete file-font lease initialization in image fixtures

* docs: keep the #4568 entry in the file-format parity status line

* fix(pdf): keep a line with another glyph for the same character as outlines (review)

A font kept with the document has one glyph per character. A glyph of the file's font that
differs from the one already kept for its character (a stylistic alternate that maps to the same
Unicode scalar) marks its line, which is imported as outlines so each glyph draws as the file
does.

* docs: resolve the leftover status-line conflict

* Placed document blob: give the new ImageBlob literal its file_font

* Test: a PDF's two glyphs for one character survive a native save and reopen as the file draws them

* Test: move the native save and reopen half of the two-glyphs regression to the engine (layers: no format dev-dep in pdf)

* Fix embedded-font preference help and English fallback checks

* Format embedded-font preference help with the workspace edition

---------

Co-authored-by: FredApps <[email protected]>
Co-authored-by: skylartaylor <[email protected]>
2026-11-22 18:18:18 -06:00
dotCooCoo 675c53eed6 Merge main into fix/retype-drawn-shape-font-state 2026-11-21 21:21:54 -08:00
dotCooCoo 14b2ec5bbf Merge main into feat/retype-installed-fonts 2026-11-21 21:18:21 -08:00
BFlat db9acab4da Merge pull request #9004 from dotCooCoo/fix/retype-even-odd-turned-counters
Retype: a glyph in an even-odd compound matches with only some of its contours reversed
2026-11-22 11:38:53 +07:00
BFlat b9c9e82f74 Merge pull request #8943 from dotCooCoo/fix/font-version-rescan-and-steady-gate
Fonts: a rescan clears the version record after it publishes its catalog
2026-11-22 11:36:13 +07:00
dotCooCoo f22565d597 Merge main into feat/retype-installed-fonts 2026-11-21 08:55:26 -08:00
dotCooCoo c8d02b0dbd Retype: a glyph in an even-odd compound matches with only some of its contours reversed
An even-odd compound paints the same whichever way each contour runs, so
an o's counter may run the same way as its outer contour. Such a part
matched neither as it is nor with all its contours reversed, and stayed
an outline at tolerance 0. A part of a split compound is now also read
with each contour turned the way its depth gives (outer contours one way,
their counters the other), both ways round. In a nonzero compound those
contours paint the counter, and the painted-area check still keeps the
part an outline.

The containment test that splits a compound into glyphs moves into its
own function, `containers`, which the new reading also calls.

Docs: docs/mcp.md, docs/type-parity.md.
2026-11-21 01:58:44 -08:00
dotCooCoo c6d9298540 Merge main into fix/retype-remeasure-budget 2026-11-20 22:30:12 -08:00
dotCooCoo 1346b182cf Merge main into fix/retype-drawn-shape-font-state 2026-11-20 21:34:33 -08:00
dotCooCoo 7f3888c59d Fonts: a rescan clears the version record after it publishes its catalog
A rescan of the font folders cleared the record of families whose other
versions had been looked for before it walked the folders. A version
lookup made during the walk read the old catalog and recorded its family
again, so a version the rescan found stayed hidden until the next scan.
The record is now cleared after the new catalog is written.

- The font gate used by tests: a thread's first SteadyFonts no longer
  waits for a font change that is itself waiting for guards other
  threads hold, so a guarded test does not hang when another test queues
  a change. It still waits for a change under way and for a waiting
  change that can start.
- Tests that check a change waits for a guard now read the gate's own
  decision, recorded under its lock, instead of the request to change.
2026-11-20 21:07:47 -08:00