Struct drawing::TextureFont
source · pub struct TextureFont<D: Device> { /* private fields */ }
Trait Implementations§
source§impl<D: Device> Font<D> for TextureFont<D>
impl<D: Device> Font<D> for TextureFont<D>
source§fn create(bytes: Vec<u8>) -> Result<Self>
fn create(bytes: Vec<u8>) -> Result<Self>
Safe to call from any thread for any device type (even for OpenGL).
To achieve it the device specific resources creation (like texture)
is delayed to the first draw() call.
fn draw( &mut self, device: &mut D, target: &D::RenderTarget, color: &Color, text: &str, pos: Point, clipping_rect: Rect, font_params: FontParams, transform: UnknownToDeviceTransform ) -> Result<()>
source§fn get_dimensions(
&mut self,
params: FontParams,
text: &str
) -> Result<(u16, u16)>
fn get_dimensions( &mut self, params: FontParams, text: &str ) -> Result<(u16, u16)>
Safe to call from any thread for any device type (even for OpenGL).
To achieve it the device specific resources creation (like texture)
is delayed to the first draw() call.
source§fn get_dimensions_each_char(
&mut self,
params: FontParams,
text: &str
) -> Result<(Vec<i16>, u16)>
fn get_dimensions_each_char( &mut self, params: FontParams, text: &str ) -> Result<(Vec<i16>, u16)>
Safe to call from any thread for any device type (even for OpenGL).
To achieve it the device specific resources creation (like texture)
is delayed to the first draw() call.
Auto Trait Implementations§
impl<D> Freeze for TextureFont<D>
impl<D> RefUnwindSafe for TextureFont<D>
impl<D> Send for TextureFont<D>
impl<D> Sync for TextureFont<D>
impl<D> Unpin for TextureFont<D>
impl<D> UnwindSafe for TextureFont<D>
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