Struct drawing::TextureFont
source · [−]pub struct TextureFont<D: Device> { /* private fields */ }Trait Implementations
sourceimpl<D: Device> Font<D> for TextureFont<D>
impl<D: Device> Font<D> for TextureFont<D>
sourcefn 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. Read more
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<()>
sourcefn 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. Read more
sourcefn 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. Read more
Auto Trait Implementations
impl<D> RefUnwindSafe for TextureFont<D> where
<D as Device>::Texture: RefUnwindSafe,
impl<D> Send for TextureFont<D> where
<D as Device>::Texture: Send,
impl<D> Sync for TextureFont<D> where
<D as Device>::Texture: Sync,
impl<D> Unpin for TextureFont<D> where
<D as Device>::Texture: Unpin,
impl<D> UnwindSafe for TextureFont<D> where
<D as Device>::Texture: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more