pub struct TextOptions {
pub max_texture_side: usize,
pub color_transfer_function: FontColorTransferFunction,
pub font_hinting: bool,
pub subpixel_binning: bool,
}Expand description
Controls how we render text
Fields§
§max_texture_side: usizeMaximum size of the font texture.
color_transfer_function: FontColorTransferFunctionControls how to convert glyph colors when writing to the font atlas.
font_hinting: boolWhether to enable font hinting
(round some font coordinates to pixels for sharper text).
Default is true.
subpixel_binning: boolEnable sub-pixel binning for glyphs.
Sub-pixel binning renders each glyph at up to four fractional horizontal offsets, giving more even kerning at the cost of more atlas space.
It also lead to text looking more blurry.
This is always disabled for CJK characters (which have too many unique glyphs).
Can be overridden per font with FontTweak::subpixel_binning.
Default: true.
Trait Implementations§
Source§impl Clone for TextOptions
impl Clone for TextOptions
Source§fn clone(&self) -> TextOptions
fn clone(&self) -> TextOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextOptions
Source§impl Debug for TextOptions
impl Debug for TextOptions
Source§impl Default for TextOptions
impl Default for TextOptions
Source§impl<'de> Deserialize<'de> for TextOptions
impl<'de> Deserialize<'de> for TextOptions
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TextOptions
impl PartialEq for TextOptions
Source§fn eq(&self, other: &TextOptions) -> bool
fn eq(&self, other: &TextOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TextOptions
impl Serialize for TextOptions
impl StructuralPartialEq for TextOptions
Auto Trait Implementations§
impl Freeze for TextOptions
impl RefUnwindSafe for TextOptions
impl Send for TextOptions
impl Sync for TextOptions
impl Unpin for TextOptions
impl UnsafeUnpin for TextOptions
impl UnwindSafe for TextOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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