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, &'static str>
fn create(bytes: Vec<u8>) -> Result<Self, &'static str>
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: PixelPoint, clipping_rect: Option<PixelRect>, font_params: FontParams, transform: Transform2D<f32, PixelUnit, DeviceUnit>, ) -> Result<(), &'static str>
Source§fn get_dimensions(
&mut self,
params: FontParams,
text: &str,
) -> Result<(u16, u16), &'static str>
fn get_dimensions( &mut self, params: FontParams, text: &str, ) -> Result<(u16, u16), &'static str>
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), &'static str>
fn get_dimensions_each_char( &mut self, params: FontParams, text: &str, ) -> Result<(Vec<i16>, u16), &'static str>
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> UnsafeUnpin 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