pub struct FontArguments<'vp, 'p> { /* private fields */ }Expand description
Represents a set of actual arguments for a font.
Implementations§
Source§impl FontArguments<'_, '_>
impl FontArguments<'_, '_>
Sourcepub fn new() -> FontArguments<'_, '_>
pub fn new() -> FontArguments<'_, '_>
Creates default font arguments.
Sourcepub fn set_collection_index(
&mut self,
collection_index: usize,
) -> &mut FontArguments<'_, '_>
pub fn set_collection_index( &mut self, collection_index: usize, ) -> &mut FontArguments<'_, '_>
Specifies the index of the desired font.
Font formats like ttc, dfont, cff, cid, pfr, t42, t1, and fon may actually be indexed collections of fonts.
collection_index: index of the font in an indexed collection.
Sourcepub fn set_variation_design_position(
self,
position: VariationPosition<'_>,
) -> FontArguments<'_, '_>
pub fn set_variation_design_position( self, position: VariationPosition<'_>, ) -> FontArguments<'_, '_>
Specifies a position in the variation design space.
Any axis not specified uses the default value. Any specified axis not actually present in the font is ignored.
This borrows position data; the value must remain valid for the lifetime of
FontArguments.
position: variation coordinates to use.
Sourcepub fn collection_index(&self) -> usize
pub fn collection_index(&self) -> usize
Returns the index of the selected font in an indexed collection.
Sourcepub fn variation_design_position(&self) -> VariationPosition<'_>
pub fn variation_design_position(&self) -> VariationPosition<'_>
Returns the variation design position.
Sourcepub fn set_palette(self, palette: Palette<'_>) -> FontArguments<'_, '_>
pub fn set_palette(self, palette: Palette<'_>) -> FontArguments<'_, '_>
Specifies the color palette and optional palette entry overrides.
This borrows palette data; the value must remain valid for the lifetime of
FontArguments.
palette: palette index and override entries.
Sourcepub fn set_synthetic_bold(
&mut self,
synthetic_bold: impl Into<Option<bool>>,
) -> &mut FontArguments<'_, '_>
pub fn set_synthetic_bold( &mut self, synthetic_bold: impl Into<Option<bool>>, ) -> &mut FontArguments<'_, '_>
Sets whether synthetic bold styling is requested.
synthetic_bold:Some(true)to force synthetic bold,Some(false)to force non-bold,Noneto leave unspecified.
Sourcepub fn synthetic_bold(&self) -> Option<bool>
pub fn synthetic_bold(&self) -> Option<bool>
Returns the synthetic bold preference, if specified.
Sourcepub fn set_synthetic_oblique(
&mut self,
synthetic_oblique: impl Into<Option<bool>>,
) -> &mut FontArguments<'_, '_>
pub fn set_synthetic_oblique( &mut self, synthetic_oblique: impl Into<Option<bool>>, ) -> &mut FontArguments<'_, '_>
Sets whether synthetic oblique styling is requested.
synthetic_oblique:Some(true)to force synthetic oblique,Some(false)to force non-oblique,Noneto leave unspecified.
Sourcepub fn synthetic_oblique(&self) -> Option<bool>
pub fn synthetic_oblique(&self) -> Option<bool>
Returns the synthetic oblique preference, if specified.