Struct genpdf::style::Style [−][src]
pub struct Style { /* fields omitted */ }
Expand description
A style annotation for a string.
The annotation consists of:
- a font family, see
FontFamily
(defaults to theFontCache
default) - a font size in points (defaults to 12)
- a line spacing factor, with 1 meaning single line spacing (defaults to 1)
- an outline color, see
Color
(defaults to black) - a combination of text effects, see
Effect
(defaults to none)
All properties are optional. If they are not set, they can be inferred from parent styles or from the defaults.
Implementations
Combines this style and the given style and returns the result.
Creates a new style by combining the given styles.
Returns the font size for this style in points, or 12 if no font size is set.
Returns the line spacing factor for this style, or 1 if no line spacing factor is set.
Sets the italic effect for this style.
Sets the font family for this style.
Sets the font family for this style and returns it.
Sets the line spacing factor for this style.
Sets the line spacing factor for this style and returns it.
Sets the font size in points for this style.
Sets the font size in points for this style and returns it.
Sets the outline color for this style and returns it.
Calculates the width of the given character with this style using the data in the given font cache.
If the font family is set, it must have been created by the given FontCache
.
Calculates the width of the given string with this style using the data in the given font cache.
If the font family is set, it must have been created by the given FontCache
.
Returns the font family for this style or the default font family using the given font cache.
If the font family is set, it must have been created by the given FontCache
.
Returns the font for this style using the given font cache.
If the font family is set, it must have been created by the given FontCache
.
Calculates the line height for strings with this style using the data in the given font cache.
If the font family is set, it must have been created by the given FontCache
.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Performs the conversion.
Creates a value from an iterator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Style
impl UnwindSafe for Style
Blanket Implementations
Mutably borrows from an owned value. Read more