Repository navigation
Drawings: a title block's text is set once while its sheet fills in, not again for each view drawn - #12776
Closed
CamWight wants to merge 5 commits into
Closed
Drawings: a title block's text is set once while its sheet fills in, not again for each view drawn#12776CamWight wants to merge 5 commits into
CamWight wants to merge 5 commits into
Conversation
…the sheet reply's schema (tangency-labs#4890) One rule for everything that puts text on a sheet: `Scene::font_records_beyond` counts only what a scene's font table doesn't hold yet, `TextRun::reach` says how far a run's glyphs go along its baseline, and `drawing.scene`'s schema has text runs and fonts, never a font's bytes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n the table Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tangency-labs#4896 W19h) A dimension on a sheet now carries its text: each value is set in the drawing's font and language, measured, and placed along the dimension's text direction, reading from the bottom or the right. Arrows flip by the measured text width. A text the font can't set leaves the lines and says why. The scene adds each dimension's fonts to its table once, counting their records against the scene's limit, and measures text by its outlines for an object's bounds. A dimension is read again when the drawing's units, language or font change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ncy-labs#4890 B3, tangency-labs#3875) Each label is set as one line at its place, and each text cell's value in its value box by the cell text rule, broken between words to the box's width when its fit wraps, in the drawing's font and language. What doesn't fit is shown whole and noted; a text no font can set is left off the sheet and noted with why, so the sheet and its export never fail over one cell. drawing.inspect lists each cell's notes; the sheet scene sets what was measured. What a cell shows is worked out in one place for drawing.inspect and the scene. The block's fonts count toward the scene's records with the border, so no view takes them, and the scene is drawn again when the design or a cell's text changes. Ported from the personal PC's 1951bc6 onto today's drawings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and its faces in the key (tangency-labs#4890 F5) The sheet scene read its title block's fields and set their text again on every extract that missed its last answer, and views are drawn one a tick, so a sheet filling in weighed the documented component and laid out the block once for each view drawn. The text is now kept with the last scene and set again only for another sheet, drawing, design, model or lettering. A scene is reused only for the same faces too: one family name can mean another face once a font is installed or removed, and that face is another scene. A family with no face is set in the built-in font, so it stays the same scene until it's found. Ported from the personal PC's d82fd03 onto today's title block text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 6, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
A drawing sheet's scene is the picture of one sheet: its border, its views, its dimensions and its title block. The window gets it from the sheet scene, which keeps its last answer and builds a new one when something changes. While a sheet fills in, its views are drawn one each tick, and before this PR every new view also made the title block read its fields and set its text again. That meant weighing the documented component again for a mass or material cell. Now the title block's text is set once and kept with the last answer. It is set again only for another sheet, drawing, design, model state or drawing lettering (units, language, font).
A scene is also reused only for the same font faces. One font family name can mean another face once a font is installed or removed, and that face gives another scene. A font installed while the drawing is open shows the next time the text is set again (after an edit, a model change or a change of sheet), not at once: nothing watches for installed fonts. A family with no face on the computer is set in the built-in font, so its scene doesn't change until the family is found.
Part of #4890, into
drawings. Stacked on the title block text PR #12357 (itself on #12356 and #12113): this PR holds their commits below its own, so review only its own top commit. Merge order: #12113, #12356, #12357, then this PR, then the sheet text PR that sits on it (#12778).Changes a default: no
Nothing a user gets out of the box changes: the same text is set from the same fields, only less often, and nothing is saved.
What it does
In
crates/engine/src/drawing_scene.rs:Assembled::reads(sheet, drawing, design, state, lettering)is the one check for "the same sheet, drawing, design, model state and lettering". The fast path that returns the last answer uses it, and so does keeping the title block's text.text: Arc<Set>) beside its cells. Whenreadsholds, the next answer takes both from it, so a view drawn sets no text.block_text(record, lettering, cells)is the one way from a block's cells to its text on paper. Export (build) and the window's scene (extract) both call it.assembletakes that text instead of the lettering and cells, so it no longer measures anything.Set::faces, intitle_block_text.rs: the font ids, each once) are all the same.Validation
Local, Windows,
--profile ci, ondrawingsa7c0310 (merged with the latest, 67a3258, and checked again there):cargo check --all-targetsandcargo fmt --checkof geom, sketch, doc, io and engine at each commit of the stack.-D warnings, assets, icons, licences, lists, layers, ui-containers, mesh-decisions, wasm and web offline pass. Tests of the 17 crates the stack can reach: the sketch library 390 passed;drawing_scene73,drawing_dimension_paper17,drawing_export11,title_block_text7 and the sketchfonts29 all pass. 37 tests fail elsewhere: 31 are intests/KNOWN_FAILING_TESTS, and 6 are in the kernel's boolean property tests, an xtask path test and the agent chat, which use none of the changed code.Tests, in
drawing_scene_tests.rs:a_scene_is_for_the_faces_its_title_blocks_text_is_set_in: the views drawn set no text (the sameSet, before and after the sheet fills in); the scene's fonts are the text's faces; the same face keeps the scene and its generation; another face under the same family name gives a new scene equal to the exported one; a family with no face is the same scene.a_title_blocks_text_follows_its_sheet_and_the_model: back and forth between two sheets, each shows its own block; after a checkpoint is restored, the mass is read from the model as it now is.a_title_blocks_text_follows_the_model_state_alone: only the model state changes (the design is the same) and the mass follows.assembletests take the block's labels set byblock_text.Planted faults, each caught by a failing test, then a clean run:
On 5 Nov, the first run caught 3 of these 4. The model-state fault was missed: no test changed only the state.
a_title_blocks_text_follows_the_model_state_alonewas added, and the next run caught all 4. On this push, 4 of 4 caught.What the tests don't reach: a font installed on the computer while the drawing is open (the tests plant another face instead).
Screenshots of the behavior
None. No window code draws sheet scenes yet, so nothing changes on screen, and exported sheets are the same as before.
Integration status
On
drawingsa7c0310 (merged with the latest, 67a3258, and checked again there), on 2026-11-06: #12113's two commits, #12356's, #12357's, then this one. When the PRs under it squash-merge, it is replayed onto them.Open PRs on the same files (
drawing_scene.rs,drawing_scene_tests.rs,title_block_text.rs), bygit merge-tree. This commit adds no conflict to any of them beyond what #12357 already has: