pub struct TextStyle { /* private fields */ }Expand description
Immutable logical em size and raster DPI, independent of text color/placement.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub fn new(
logical_em_size: LogicalPixels,
scale: PhysicalPerLogical,
) -> Result<Self, FontError>
pub fn new( logical_em_size: LogicalPixels, scale: PhysicalPerLogical, ) -> Result<Self, FontError>
Creates a logical-pixel em size and physical-pixels-per-logical-pixel scale. Rejects an overflowing or subnormal physical em size.
Sourcepub const fn with_direction(self, direction: TextDirection) -> Self
pub const fn with_direction(self, direction: TextDirection) -> Self
Selects shaping direction without changing em size or raster DPI.
Sourcepub const fn logical_em_size(self) -> LogicalPixels
pub const fn logical_em_size(self) -> LogicalPixels
Logical pixels per em; not font ascent-minus-descent height.
Sourcepub const fn scale(self) -> PhysicalPerLogical
pub const fn scale(self) -> PhysicalPerLogical
Physical pixels per logical pixel used for glyph rasterization.
Sourcepub const fn direction(self) -> TextDirection
pub const fn direction(self) -> TextDirection
Requested horizontal shaping direction.
Sourcepub fn physical_em_size(self) -> f32
pub fn physical_em_size(self) -> f32
Physical pixels per em, validated at construction.
Trait Implementations§
impl Copy for TextStyle
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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