feat: define semantic style identities and compatible inheritance

This commit is contained in:
2026-10-30 10:11:49 +08:00
parent a09fa8b885
commit 8f753d665f
5 changed files with 179 additions and 0 deletions
+2
View File
@@ -87,6 +87,8 @@ def line_points(rule: dict, font_pt: float) -> float:
def resolved_rules(rules: dict | None, font_family: str = "", font_size_px: float = 16, preset: str = "default") -> dict[str, dict]:
"""Reader defaults, not Word's theme-dependent defaults."""
from .style_catalog import explicit_rules
rules = explicit_rules(rules)
base = dict(chinese_font_family=font_family or "Microsoft YaHei UI", english_font_family=font_family or "Microsoft YaHei UI",
font_size=font_size_px, font_size_unit="px", bold=False, italic=False,
font_color="auto", line_spacing_mode="multiple", line_height_value=1.72,