fix(arch, table): what the 1.6.0 README renders showed

- The exterior dimension chains follow the plot scale. DIMSCALE is the
  plan's scale while they are drawn and is put back afterwards; a 1:50
  chain's 2.5 text had been 2.5 drawing units, 0.05 mm on the sheet.
- A headless TABLE merges its title row, as AutoCAD's TABLE does; a long
  title no longer wraps inside the first column over the header row.
- A headless TABLE's cell margin scales with the lettering. A flat 1.0 was
  0.02 mm on a 1:50 schedule; tables at the default 2.5 text are unchanged.
- drawing_new writes the Standard text style in arial.ttf, as AutoCAD
  2026's acadiso.dwt ships it: txt has no superscript two, so 'm²' read
  'm?' live and rendered as a box headlessly. The five bundled templates
  are rebuilt and build_templates --check reproduces them.

Each fix has a test that fails on the old code.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
Umut CAN
2026-09-25 00:17:10 +03:00
co-authored by Claude Opus 5.5
parent 554daff8d0
commit 7e7fe11a71
13 changed files with 182 additions and 370 deletions
+4 -1
View File
@@ -11,6 +11,9 @@ class TableLayout:
column_widths: list[float]
row_height: float
text_height: float
#: The first row is a title, merged across every column as AutoCAD's
#: TABLE draws it.
title_row: bool = False
@property
def row_count(self) -> int:
@@ -71,7 +74,7 @@ def prepare_table_layout(
if any(width <= 0 for width in widths):
raise RuntimeError("entity_create_table: column widths must be positive")
return TableLayout(data, widths, float(row_height), float(text_height))
return TableLayout(data, widths, float(row_height), float(text_height), title_row=bool(title))
def validate_mleader(points: list[list[float]], text: str) -> list[tuple[float, float]]: