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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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]>
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.
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.
* 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]>
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.
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.