Struct FontArguments
pub struct FontArguments<'vp, 'p> { /* private fields */ }Expand description
Represents a set of actual arguments for a font.
Implementations§
§impl FontArguments<'_, '_>
impl FontArguments<'_, '_>
pub fn new() -> FontArguments<'_, '_>
pub fn new() -> FontArguments<'_, '_>
Creates default font arguments.
pub 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.
pub 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.
pub fn collection_index(&self) -> usize
pub fn collection_index(&self) -> usize
Returns the index of the selected font in an indexed collection.
pub fn variation_design_position(&self) -> VariationPosition<'_>
pub fn variation_design_position(&self) -> VariationPosition<'_>
Returns the variation design position.
pub 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.
pub 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.
pub fn synthetic_bold(&self) -> Option<bool>
pub fn synthetic_bold(&self) -> Option<bool>
Returns the synthetic bold preference, if specified.
pub 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.
pub fn synthetic_oblique(&self) -> Option<bool>
pub fn synthetic_oblique(&self) -> Option<bool>
Returns the synthetic oblique preference, if specified.
Trait Implementations§
§impl Debug for FontArguments<'_, '_>
impl Debug for FontArguments<'_, '_>
§impl Default for FontArguments<'_, '_>
impl Default for FontArguments<'_, '_>
§fn default() -> FontArguments<'_, '_>
fn default() -> FontArguments<'_, '_>
§impl Drop for FontArguments<'_, '_>
impl Drop for FontArguments<'_, '_>
§impl From<FontArguments<'_, '_>> for Handle<skia_textlayout_FontArguments>
impl From<FontArguments<'_, '_>> for Handle<skia_textlayout_FontArguments>
§fn from(fa: FontArguments<'_, '_>) -> Handle<skia_textlayout_FontArguments>
fn from(fa: FontArguments<'_, '_>) -> Handle<skia_textlayout_FontArguments>
Auto Trait Implementations§
impl<'vp, 'p> Freeze for FontArguments<'vp, 'p>
impl<'vp, 'p> RefUnwindSafe for FontArguments<'vp, 'p>
impl<'vp, 'p> !Send for FontArguments<'vp, 'p>
impl<'vp, 'p> !Sync for FontArguments<'vp, 'p>
impl<'vp, 'p> Unpin for FontArguments<'vp, 'p>
impl<'vp, 'p> UnsafeUnpin for FontArguments<'vp, 'p>
impl<'vp, 'p> UnwindSafe for FontArguments<'vp, 'p>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.