Repository navigation
feat: decode TEXT and MTEXT entities and render annotations in SVG and 2D viewer - #75
Merged
Merged
Conversation
# Conflicts: # src/DwgIO.Cli/Export/DwgCadHtmlViewer.cs
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.
Summary
RecordStringStreamhelper to read R2004 inline codepage strings and R2007+ separate UTF-16LE object string streams cleanly acrossLayerParserandEntityDecoder(also fixing R2007+CMENCcolor name/book skipping inEntityDecoder).TEXT(0x01) andMTEXT(0x2C) entity bodies inEntityDecoder:TEXT:DataFlagsconditionally parsed fields (Elevation,InsertionPt,AlignmentPt,Oblique,Rotation,Height,WidthFactor, alignment flags, and text value), selectingAlignmentPtwhen aligned.MTEXT:InsertionPt,XAxisDir(computing rotation angle),RectWidth,RectHeight(R2007+),TextHeight,Attachment, and multiline formatted string.DwgEntityKind.Text,DwgEntityKind.MText,DwgEntity.Text, andDwgEntity.PlainText(stripping MTEXT formatting codes such as\P,\~,\S...;,\f...;,\C...;,{...}).TEXTandMTEXTin:DwgJsonExporter(textandplainTextfields)DwgSvgExporter(<text>/<tspan>elements with rotation and viewBox expansion)DwgCadHtmlViewer(rotated/anchored multiline canvas text rendering, hit-testing, properties panel, and searchable text)dwgio inspect/entities(DwgEntity.ToString())TextEntitiesTestscovering R2018 & R2004TEXTandMTEXT, alignment handling, MTEXT escape stripping, JSON, SVG, and 2D HTML viewer exports.Stacked on #74.
Verification
dotnet build DwgIO.slnx -c Release— 0 warnings, 0 errorsdotnet test DwgIO.slnx -c Release --no-build— 288 passed, 0 failed, 1 skipped (unconfigured private fixtures) on bothnet8.0andnet10.0BuildNativeCoreOnly=truepassed cleanly for bothDwgIO.csprojandDwgIO.Scene.csproj