Repository navigation
DWG reader: a seeded Standard dimension style points at the file's text style - #650
Merged
HakanSeven12 merged 2 commits intoNov 24, 2026
Merged
Conversation
…e ByBlock linetype as its text style A drawing whose only dimension style is ISO-25, with the Standard text style at hakanaktt#11 and the ByBlock linetype at hakanaktt#14 as other CAD programs save it: the Standard dimension style the DWG reader seeds survives with DIMTXSTY hakanaktt#14, and the drawing written again carries it. Both tests fail on this commit.
…xt style The DWG reader seeds a Standard dimension style before it reads the file; a drawing with none of its own keeps it. Its DIMTXSTY still named the seeded Standard text style's handle, which the file may have given to a record of another table - hakanaktt#14, the ByBlock linetype, in drawings other CAD programs save. Written again, the Standard dimension style named a linetype as its text style, and the reference application's AUDIT reported an error in every such drawing. The DXF reader repairs this since hakanaktt#64 (rewire_stale_text_style_references); the DWG builder now runs the same repair once the file's records hold their handles. A guard test checks that a file's own Standard dimension style keeps the text style it names.
ohagmann
marked this pull request as ready for review
November 24, 2026 13:40
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.
Closes #649
Commits
d3d4b93c— red tests only (tests/dwg_seeded_dimstyle_text_style.rs). A DWG with the Standard text style at#11, the ByBlock linetype at#14and ISO-25 as its only dimension style:a_seeded_standard_dim_style_points_at_the_files_text_style: after the read, the surviving seeded Standarddimension style names a text style, the file's Standard one;
a_dwg_written_again_names_a_text_style_in_every_dim_style: read and written again, every dimension style'sDIMTXSTY is a text style, and ISO-25 keeps its own.
Both fail on this commit for the reason in the issue, locally and in CI (Test (ubuntu-latest), run 45397759800):
8234fd23— the fix: the DWG document builder runsrewire_stale_text_style_references, therepair the DXF reader has since DXF round-trip writes a ByBlock linetype handle as the DIMSTYLE text style #64, once the handle-collision repair is done; the function becomes
pub(crate)and is re-exported from
io::dxf. A guard test (a_files_own_standard_dim_style_keeps_its_text_style) checksthat a file's own Standard dimension style keeps the text style it names.
Verification
cargo test3267 passed,cargo test --no-default-features3267 passed,cargo test --all-features3363 passed, 0 failed each;tests/issue64.rsstill green.on macos-latest the default and sequential test steps pass and the all-features step was cancelled at the job's time
limit (30 min), as in the macOS run main retriggered today.
issue again. The Standard DIMSTYLE's 340 now points at the STYLE record, and the reference application's AUDIT
reports 0 errors where it reported 1 before (one drawing keeps the one error it already had in the original).