pub struct Font { /* private fields */ }
Implementations§
source§impl Font
impl Font
pub fn default(ugli: &Ugli) -> Self
pub fn new(ugli: &Ugli, data: &[u8], options: &Options) -> Result<Self>
pub fn max_distance(&self) -> f32
pub fn ascender(&self) -> f32
pub fn descender(&self) -> f32
pub fn line_gap(&self) -> f32
pub fn measure(&self, text: &str, align: vec2<TextAlign>) -> Option<Aabb2<f32>>
pub fn advance(&self, text: &str) -> f32
pub fn draw_with<R>( &self, text: &str, align: vec2<TextAlign>, f: impl FnOnce(&[GlyphInstance], &Texture) -> R ) -> R
pub fn draw( &self, framebuffer: &mut Framebuffer<'_>, camera: &(impl AbstractCamera2d + ?Sized), text: &str, align: vec2<TextAlign>, transform: mat3<f32>, color: Rgba<f32> )
pub fn draw_with_outline( &self, framebuffer: &mut Framebuffer<'_>, camera: &(impl AbstractCamera2d + ?Sized), text: &str, align: vec2<TextAlign>, transform: mat3<f32>, color: Rgba<f32>, outline_size: f32, outline_color: Rgba<f32> )
pub fn create_text_sdf( &self, text: &str, line_align: TextAlign, pixel_size: f32 ) -> Option<Texture>
Auto Trait Implementations§
impl !RefUnwindSafe for Font
impl !Send for Font
impl !Sync for Font
impl Unpin for Font
impl UnwindSafe for Font
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