forked from 1b-agent/opencadstudio-upstream
feat(mtext): lay out \N columns and stack \S fractions
Two things an MTEXT can ask for that the layout ignored, both found on the same drawing (budweiser2018.dwg handles 8782 and 2609). Columns: `column_data` was read but only ever reached the properties panel, so a three-column MTEXT ran as one stacked block. Each line now carries the column it belongs to, the row counter restarts per column, and wrapping measures against the column rather than the block — measuring against the block would let a line run across the gutter and over its neighbour. Paragraph alignment already worked, which is what made the bug read as "columns are there but misplaced": `\pxqr;` pushed col3 to the right edge either way. Only explicit `\N` breaks move to the next column. A column that fills up does not spill into the next on its own — `heights` / `auto_height` are not read, so a column runs as long as its content. Stacking: `\S1/2;` was flattened to the literal "1/2", which is why the line then overflowed its 7.26-wide box and dropped `°C ª` onto a second row. The halves now share one horizontal slot, drawn at a shrunk height with the numerator lifted, so the slot is as wide as the wider half. `^` stacks without a rule; `#` stays inline `num/den`, which is what a slanted fraction reads as and needs no second baseline. The fraction rule rides a run-less stroke group: a group carrying a `GlyphRun` renders as SDF quads with its strokes suppressed, a run-less one keeps them, and the rule is plain geometry rather than a glyph. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6d7eb94701
commit
7e1cd6842b
5 files changed
+305
-21
No files matched your search
@@ -201,6 +201,8 @@ fn build_attr_truck(input: AttrTextInputs<'_>, document: &acadrust::CadDocument)
|
||||
is_upside_down: false,
|
||||
};
|
||||
let layout = layout_mtext(&MTextRenderOpts {
|
||||
// Not an MTEXT: text in a fixed box, never columnar.
|
||||
columns: Default::default(),
|
||||
value: &display_value,
|
||||
insertion: [anchor_pt.x, anchor_pt.y, anchor_pt.z],
|
||||
height: input.height as f32,
|
||||
|
||||
Reference in new issue
Block a user