/// Returns local coordinates of glyphs.
Returns local coordinates of glyphs.
Returns local coordinates of glyphs .
pub fn glyph_positions(
        &mut self,
        text: &str,
        size: u32,
        max_width: Option<f32>,
    ) -> Vec<LocalRect> {
        let mut rects = vec![];
        rects.reserve(text.len());
        self.setup_layout(text, size, max_width);
        let s = 1.0 / self.device_px_ratio;
        for glyph in self.layout.glyphs() {
            rects.push(
                LocalRect::new(
                    [glyph.x, glyph.y].into(),
                    [glyph.width as f32, glyph.height as f32].into(),
                )
                .scale(s, s),
            )
        }
        rects
    }
pub fn glyph_positions ( & mut self , text : & str , size : u32 , max_width : Option < f32 > , ) -> Vec < LocalRect > { let mut rects = vec ! [ ] ; rects . reserve ( text . len ( ) ) ; self . setup_layout ( text , size , max_width ) ; let s = 1.0 / self . device_px_ratio ; for glyph in self . layout . glyphs ( ) { rects . push ( LocalRect :: new ( [ glyph . x , glyph . y ] . into ( ) , [ glyph . width as f32 , glyph . height as f32 ] . into ( ) , ) . scale ( s , s ) , ) } rects }
Returns local coordinates of glyphs.
Returns local coordinates of glyphs .
&mut self
text
&str
size
u32
max_width
Option<f32>