diff --git a/src/gles_render/setup.rs b/src/gles_render/setup.rs index 25e7cd4..5d08cb6 100644 --- a/src/gles_render/setup.rs +++ b/src/gles_render/setup.rs @@ -772,11 +772,11 @@ impl GlesCanvas self.font_for_char( ch ).metrics( ch, size * self.dpi_scale ) } - /// Horizontal line metrics of the default font at `size` px (`None` if the - /// font lacks them). Not pre-scaled by `dpi_scale`. + /// Horizontal line metrics of the default font at `size` logical px (`None` + /// if the font lacks them), pre-scaled by `dpi_scale`. pub fn font_line_metrics( &self, size: f32 ) -> Option { - self.font.horizontal_line_metrics( size ) + self.font.horizontal_line_metrics( size * self.dpi_scale ) } /// Resize the FBO and viewport. The previous color attachment is freed and diff --git a/src/render/mod.rs b/src/render/mod.rs index 41ab104..226bdfe 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -529,10 +529,11 @@ impl Canvas self.font().metrics( ch, size * self.dpi_scale() ) } - /// Convenience wrapper around `font().horizontal_line_metrics(...)`. + /// Convenience wrapper around `font().horizontal_line_metrics(...)`, + /// pre-scaled by `dpi_scale` like [`Self::font_metrics`]. pub fn font_line_metrics( &self, size: f32 ) -> Option { - self.font().horizontal_line_metrics( size ) + self.font().horizontal_line_metrics( size * self.dpi_scale() ) } pub fn resize( &mut self, width: u32, height: u32 )