feat: write the stroke weight of items that have none of their own

This commit is contained in:
aiongg committed 2026-10-07 16:24:18 +00:00
1 parent 3da31dc6c2
commit 6f8a8fe932
2 files changed
+23 -2

No files matched your search

+12
View File
@@ -589,6 +589,18 @@ set the converter leaves both attributes out. In 14,918 items with
chunk 0x1424 the master item is 0; in 197 of them the list still holds
IDs, and IDML writes the attribute empty.
**Stroke weight without an attribute.** An item whose attribute list has
no stroke weight (attribute 0x6E65) and whose object style is `[None]`
has `StrokeWeight="1"` in IDML: in the trustworthy pairs, 31,252 of
31,252 polygons, 5,294 of 5,294 rectangles, 702 of 702 ovals, 214 of
214 graphic lines and 4,248 of 4,263 text frames (15 have 0.28). With
another object style the attribute is absent in IDML (the style supplies
it), apart from 160 text frames with `[Normal Text Frame]` and 10 lines
with styles of their own, which have 1. Groups vary (1,166 without the
attribute, 625 with 1 and 30 with other values, in 200 of the pairs)
and get none. The converter
writes 1 for items other than groups with the style `[None]`.
## Text wrap
Page items (class 0x6201 and groups, 0x401) and placed graphics have
+11 -2
View File
@@ -3740,10 +3740,19 @@ impl Writer<'_> {
x.attr("ContentType", content);
}
self.item_attrs(x, &item.attrs);
if let Some(os) = item
let style = item
.object_style
.and_then(|u| self.doc.object_styles.get(&u))
.and_then(|u| self.doc.object_styles.get(&u));
// An item without a stroke weight of its own and with the object
// style [None] has `StrokeWeight="1"` in IDML (objects.md, page
// item settings); groups vary.
if tag != "Group"
&& item.attrs.0.iter().all(|(id, _)| *id != 0x6E65)
&& style.is_some_and(|os| os.builtin && os.name == "[None]")
{
x.attr("StrokeWeight", "1");
}
if let Some(os) = style {
let name = if os.builtin {
format!("$ID/{}", os.name)
} else {