mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-15 06:52:23 +00:00
Write tab stop lists through shared IDML model
This commit is contained in:
1 file changed
+16
@@ -369,6 +369,22 @@ impl TabStopValues {
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Writes tab-stop records in a `TabList` property.
|
||||
pub fn to_list(stops: &[Self]) -> El {
|
||||
let mut list = El::new("TabList").with_attr("type", "list");
|
||||
for stop in stops {
|
||||
list.push(
|
||||
El::new("ListItem")
|
||||
.with_attr("type", "record")
|
||||
.with_child(property("Alignment", "enumeration", stop.alignment.clone()))
|
||||
.with_child(property("AlignmentCharacter", "string", stop.alignment_character.clone()))
|
||||
.with_child(property("Leader", "string", stop.leader.clone()))
|
||||
.with_child(property("Position", "unit", crate::value::num(stop.position))),
|
||||
);
|
||||
}
|
||||
list
|
||||
}
|
||||
}
|
||||
|
||||
/// What a style styles.
|
||||
|
||||
Reference in new issue
Block a user