pub struct Styles { /* private fields */ }Expand description
Every style in a document, from both of the places they live.
Implementations§
Source§impl Styles
impl Styles
Sourcepub fn collect(content: Option<&Element>, styles: Option<&Element>) -> Self
pub fn collect(content: Option<&Element>, styles: Option<&Element>) -> Self
Collect the styles of a document from its two parts.
Both are optional because both are optional in the format: a package may
carry all its formatting in automatic styles in content.xml and no
styles.xml at all.
Sourcepub fn list_style(&self, name: &str) -> Option<&Element>
pub fn list_style(&self, name: &str) -> Option<&Element>
A list style by name, as the text:list-style-name of a list refers to
one.
Sourcepub fn master_page(&self, name: &str) -> Option<&Element>
pub fn master_page(&self, name: &str) -> Option<&Element>
A master page by name.
Sourcepub fn page_layout_of(&self, master_page: &str) -> Option<&PageLayout>
pub fn page_layout_of(&self, master_page: &str) -> Option<&PageLayout>
The page layout a master page points at.
Sourcepub fn resolve(&self, family: &Family, name: &str) -> Rc<Properties>
pub fn resolve(&self, family: &Family, name: &str) -> Rc<Properties>
The resolved properties of a style, with its whole inheritance chain and its family’s default applied.
A name that is not in the document resolves to the family’s default, which is what an application does with a dangling style reference: the paragraph is shown rather than refused.
Sourcepub fn font_family(&self, declared: &str) -> String
pub fn font_family(&self, declared: &str) -> String
The family the properties of a cell’s text come from: a cell style’s
style:parent-style-name chain carries the paragraph and text
properties, so a cell resolves in one call.