Expand description
Office 主题 <a:theme> 标准版。
PowerPoint 强制要求一份合法的 theme1.xml,否则会被 Office/WPS 拒绝打开。
这里直接采用 python-pptx 默认输出的 Office 主题,保留完整结构与所有字体脚本。
出于二进制大小考虑,省略了 latin/ea/cs 之外的 <a:font> 列表(实际 Office 主题里全是它们)。
§与 python-pptx 的对应
pptx.oxml.theme.Theme←→Theme结构体(v0.2 起支持结构化解析);pptx.parts.theme.ThemePart._element在加载时由parse_theme解析为Theme;- 写路径使用
Theme::to_xml(结构化序列化)或default_theme_xml(完整 Office 主题 XML)。
§字体脚本表
THEME_XML 完整列出了 30+ 个 script(Jpan / Hang / Hans / Hant / …),
缺失任何一个都会导致 PowerPoint 警告“主题不完整“。
Structs§
- Color
Scheme - 颜色方案(对应
<a:clrScheme>)。 - Font
Scheme - 字体方案(对应
<a:fontScheme>)。 - Format
Scheme - 格式方案(对应
<a:fmtScheme>)。 - Theme
- 结构化主题模型(对应
<a:theme>)。
Enums§
- Theme
Color - 主题颜色值(对应
<a:srgbClr>或<a:sysClr>)。
Functions§
- default_
theme_ xml - 返回完整且经过验证的 Office 主题 XML(与 python-pptx 默认输出对齐)。