Struct wr_glyph_rasterizer::rasterizer::FontInstance
source · pub struct FontInstance {
pub base: Arc<BaseFontInstance>,
pub transform: FontTransform,
pub render_mode: FontRenderMode,
pub flags: FontInstanceFlags,
pub color: ColorU,
pub size: FontSize,
}
Expand description
A mutable font instance description.
Performance is sensitive to the size of this structure, so it should only contain the fields that we need to modify from the original base font instance.
Fields§
§base: Arc<BaseFontInstance>
§transform: FontTransform
§render_mode: FontRenderMode
§flags: FontInstanceFlags
§color: ColorU
§size: FontSize
Implementations§
source§impl FontInstance
impl FontInstance
pub fn new( base: Arc<BaseFontInstance>, color: ColorU, render_mode: FontRenderMode, flags: FontInstanceFlags, ) -> Self
pub fn from_base(base: Arc<BaseFontInstance>) -> Self
pub fn use_texture_padding(&self) -> bool
pub fn use_transform_glyphs(&self) -> bool
pub fn get_alpha_glyph_format(&self) -> GlyphFormat
pub fn get_subpixel_glyph_format(&self) -> GlyphFormat
pub fn disable_subpixel_aa(&mut self)
pub fn disable_subpixel_position(&mut self)
pub fn use_subpixel_position(&self) -> bool
pub fn get_subpx_dir(&self) -> SubpixelDirection
pub fn get_subpx_offset(&self, glyph: &GlyphKey) -> (f64, f64)
pub fn get_glyph_format(&self) -> GlyphFormat
pub fn get_extra_strikes(&self, flags: FontInstanceFlags, x_scale: f64) -> usize
pub fn synthesize_italics( &self, transform: FontTransform, size: f64, ) -> (FontTransform, (f64, f64))
pub fn get_transformed_size(&self) -> f64
Trait Implementations§
source§impl Clone for FontInstance
impl Clone for FontInstance
source§fn clone(&self) -> FontInstance
fn clone(&self) -> FontInstance
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FontInstance
impl Debug for FontInstance
source§impl Hash for FontInstance
impl Hash for FontInstance
source§impl MallocSizeOf for FontInstance
impl MallocSizeOf for FontInstance
source§fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl Ord for FontInstance
impl Ord for FontInstance
source§fn cmp(&self, other: &FontInstance) -> Ordering
fn cmp(&self, other: &FontInstance) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for FontInstance
impl PartialEq for FontInstance
source§fn eq(&self, other: &FontInstance) -> bool
fn eq(&self, other: &FontInstance) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FontInstance
impl PartialOrd for FontInstance
source§fn partial_cmp(&self, other: &FontInstance) -> Option<Ordering>
fn partial_cmp(&self, other: &FontInstance) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for FontInstance
impl Serialize for FontInstance
source§impl Deref for FontInstance
impl Deref for FontInstance
§type Target = BaseFontInstance
type Target = BaseFontInstance
The resulting type after dereferencing.
source§fn deref(&self) -> &BaseFontInstance
fn deref(&self) -> &BaseFontInstance
Dereferences the value.
impl Eq for FontInstance
Auto Trait Implementations§
impl Freeze for FontInstance
impl RefUnwindSafe for FontInstance
impl Send for FontInstance
impl Sync for FontInstance
impl Unpin for FontInstance
impl UnwindSafe for FontInstance
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more