pub fn with_size(self, em_size: f32) -> FontMetrics {
        let scale_factor = em_size / self.em_size;

        FontMetrics {
            em_size:            self.em_size * scale_factor,
            ascender:           self.ascender * scale_factor,
            descender:          self.descender * scale_factor,
            height:             self.height * scale_factor,
            line_gap:           self.line_gap * scale_factor,
            capital_height:     self.capital_height.map(|height| height*scale_factor),
            underline_position: self.underline_position.map(|mut pos| { pos.offset *= scale_factor; pos.thickness *= scale_factor; pos }),
            strikeout_position: self.strikeout_position.map(|mut pos| { pos.offset *= scale_factor; pos.thickness *= scale_factor; pos }),
        }
    }
///
/// Returns the metrics adjusted to a new em size
///
Returns the metrics adjusted to a new em size
Returns the metrics adjusted to a new em size
pub fn with_size(self, em_size: f32) -> FontMetrics {
        let scale_factor = em_size / self.em_size;
        FontMetrics {
            em_size:            self.em_size * scale_factor,
            ascender:           self.ascender * scale_factor,
            descender:          self.descender * scale_factor,
            height:             self.height * scale_factor,
            line_gap:           self.line_gap * scale_factor,
            capital_height:     self.capital_height.map(|height| height*scale_factor),
            underline_position: self.underline_position.map(|mut pos| { pos.offset *= scale_factor; pos.thickness *= scale_factor; pos }),
            strikeout_position: self.strikeout_position.map(|mut pos| { pos.offset *= scale_factor; pos.thickness *= scale_factor; pos }),
        }
    }
pub fn with_size ( self , em_size : f32 ) -> FontMetrics { let scale_factor = em_size / self . em_size ; FontMetrics { em_size : self . em_size * scale_factor , ascender : self . ascender * scale_factor , descender : self . descender * scale_factor , height : self . height * scale_factor , line_gap : self . line_gap * scale_factor , capital_height : self . capital_height . map ( | height | height * scale_factor ) , underline_position : self . underline_position . map ( | mut pos | { pos . offset *= scale_factor ; pos . thickness *= scale_factor ; pos } ) , strikeout_position : self . strikeout_position . map ( | mut pos | { pos . offset *= scale_factor ; pos . thickness *= scale_factor ; pos } ) , } }
Returns the metrics adjusted to a new em size
Returns the metrics adjusted to a new em size
self
em_size
f32