Release PPT workflow 0.7.2 with text and container constraints
This commit is contained in:
@@ -112,11 +112,17 @@ def finalize(path: Path, theme: dict, style: dict):
|
||||
if ea is not None and len(fallbacks) == 1:
|
||||
ea.set("typeface", next(iter(fallbacks)))
|
||||
changed = True
|
||||
# Weight is role metadata, not an inference that all titles bold.
|
||||
# The compiler resolves source weight for every actual run;
|
||||
# it emits b="1" for bold and omits b for regular. Materialize
|
||||
# regular explicitly so a bold family/master cannot override it.
|
||||
weights = {entry.get("weight_number") for entry in entries}
|
||||
if len(weights) == 1 and None not in weights:
|
||||
run.set("b", "1" if next(iter(weights)) >= 600 else "0")
|
||||
changed = True
|
||||
if run.get("b") is None:
|
||||
if run.tag == "{" + NS["a"] + "}rPr":
|
||||
run.set("b", "0")
|
||||
changed = True
|
||||
elif len(weights) == 1 and None not in weights:
|
||||
run.set("b", "1" if next(iter(weights)) >= 600 else "0")
|
||||
changed = True
|
||||
if changed:
|
||||
tree.write(str(part), encoding="utf-8", xml_declaration=True)
|
||||
# A template's body size is its default at each nesting level. The author
|
||||
|
||||
Reference in New Issue
Block a user