Skip to main content

glyph_width

Function glyph_width 

Source
pub fn glyph_width(font: Font, size: f32, ch: char) -> f32
Expand description

Width of a single glyph in font at size points.

Base14 faces use one AFM lookup; embedded faces shape the single character.

ยงExamples

use mos_fonts::{Base14Font, Font, glyph_width};

assert_eq!(glyph_width(Font::Base14(Base14Font::Helvetica), 10.0, 'A'), 6.67);