refactor(text): parse single-line ATTRIB text via acadrust

Route single-line attribute text through the same acad_text_encode path
TEXT uses (acadrust parse_plain_text, re-encoded for the stroke
tessellator). Multi-line attributes already flow through layout_mtext
(acadrust). No visible change — attribute text with %% codes rendered
correctly before via the local tokenizer; this shares the one parser.
TOLERANCE cells and complex-linetype text still use the local tokenizer
(specialized paths that rarely carry %% codes).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-07 01:15:36 +03:00
commit 1709d41e4f
2 changed files with 5 additions and 2 deletions

View file

@ -71,7 +71,7 @@ pub struct TextPlacement {
/// inline grammar: specials arrive resolved to Unicode, and `%%u`/`%%o`
/// underline/overline become `\L…\l` / `\O…\o` decoration markers. This keeps
/// TEXT parsing in acadrust rather than OCS's own tokenizer.
fn acad_text_encode(value: &str) -> String {
pub(crate) fn acad_text_encode(value: &str) -> String {
use acadrust::entities::mtext_format::parse_plain_text;
let doc = parse_plain_text(value);
let mut out = String::new();