pub struct Theme {
pub name: String,
pub color_scheme: ColorScheme,
pub font_scheme: FontScheme,
pub format_scheme: FormatScheme,
pub partname: String,
}Expand description
结构化主题模型(对应 <a:theme>)。
解析 name / color_scheme / font_scheme / format_scheme 四个核心字段。
<a:objectDefaults> / <a:extraClrSchemeLst> 等暂不解析(写路径用 default_theme_xml)。
Fields§
§name: String主题名(<a:theme name="Office Theme">)。
color_scheme: ColorScheme颜色方案(<a:clrScheme>)。
font_scheme: FontScheme字体方案(<a:fontScheme>)。
format_scheme: FormatScheme格式方案(<a:fmtScheme>)。
partname: StringOPC part 路径(/ppt/theme/themeN.xml),用于 round-trip 保真。
新建场景为空字符串;from_opc 解析时回填,写路径优先使用此字段。
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn to_xml(&self) -> String
pub fn to_xml(&self) -> String
从结构化模型序列化为完整 theme XML。
与 default_theme_xml 不同,此方法根据 Theme 结构体的字段值
生成 XML,允许用户修改颜色方案、字体方案等。
§注意
- 字体脚本表(
<a:font script="..." typeface="..."/>)不在此方法中生成, 因为它们不影响 PowerPoint 的核心解析。如需完整字体脚本,使用default_theme_xml。 FormatScheme若raw_xml为空,使用默认 Office 格式方案。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more