Function draw_text_ex

Source
pub fn draw_text_ex(t: &str, x: f32, y: f32, p: TextParams) -> TextDimensions
Expand description

Draws classic 5×7 bitmap text with its baseline at y: one quad per horizontal run of lit font pixels in each glyph row, each exactly one font pixel tall. Coverage is identical to one quad per lit pixel with fewer vertices. Use text::draw_text_styled with text::FontFace::Classic for the same letters with vertically merged geometry, shadows and outlines.

use ferravex_render::{TextParams, WHITE, draw_text_ex, input::host_frame};
let size = host_frame(1. / 60., 320, 120, || {
    draw_text_ex("HUD 42", 8., 40., TextParams { font_size: 16, font_scale: 1., color: WHITE })
});
assert_eq!((size.width, size.height), (72., 14.));