pub struct RasterConfig {
pub mode: u8,
pub subpixel_threshold: u8,
pub subpixel_x_steps: u8,
pub subpixel_mode: SubpixelMode,
}Expand description
Font raster settings
These are not used by the theme, but passed through to the rendering backend.
Fields§
§mode: u8The mode parameter selects rendering mode (though depending on crate
features, not all options will be available). The default mode is 4.
In case the crate is built without the required fontdue or swash
feature, the rasterer falls back to mode 0.
mode == 0: useab_glyphfor rasteringmode == 1: useab_glyphand align glyphs to side bearingsmode == 2: deprecatedmode == 3: useswashfor rasteringmode == 4: useswashfor rastering with hinting
subpixel_threshold: u8Subpixel positioning threshold
Text with height h less than this threshold will use sub-pixel
positioning (see below), which should make letter spacing more
accurate for small fonts.
Units: physical pixels per Em (“dpem”). Default value: 18.
subpixel_x_steps: u8Subpixel steps (horizontal)
The number of sub-pixel positioning steps to use on the x-axis for
horizontal text (when enabled; see Self::subpixel_threshold).
Minimum: 1 (no sub-pixel positioning). Maximum: 16. Default: 3.
subpixel_mode: SubpixelModeSubpixel rendering mode
Trait Implementations§
Source§impl Clone for RasterConfig
impl Clone for RasterConfig
Source§fn clone(&self) -> RasterConfig
fn clone(&self) -> RasterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RasterConfig
impl Debug for RasterConfig
Source§impl Default for RasterConfig
impl Default for RasterConfig
Source§impl<'de> Deserialize<'de> for RasterConfig
impl<'de> Deserialize<'de> for RasterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RasterConfig
impl PartialEq for RasterConfig
Source§impl Serialize for RasterConfig
impl Serialize for RasterConfig
impl Eq for RasterConfig
impl StructuralPartialEq for RasterConfig
Auto Trait Implementations§
impl Freeze for RasterConfig
impl RefUnwindSafe for RasterConfig
impl Send for RasterConfig
impl Sync for RasterConfig
impl Unpin for RasterConfig
impl UnwindSafe for RasterConfig
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
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.