Skip to main content

TextureFont

Struct TextureFont 

Source
pub struct TextureFont<D: Device> { /* private fields */ }

Trait Implementations§

Source§

impl<D: Device> Font<D> for TextureFont<D>

Source§

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.
Source§

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>

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>

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>
where <D as Device>::Texture: RefUnwindSafe,

§

impl<D> Send for TextureFont<D>

§

impl<D> Sync for TextureFont<D>

§

impl<D> Unpin for TextureFont<D>
where <D as Device>::Texture: Unpin,

§

impl<D> UnsafeUnpin for TextureFont<D>

§

impl<D> UnwindSafe for TextureFont<D>
where <D as Device>::Texture: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.