Remove unnecessary size argument to metrics function
The changes to metric consumption rendered the size argument unnecessary, remove it.
This commit is contained in:
parent
7fc50f6690
commit
1277e07671
|
@ -135,9 +135,7 @@ impl ::Rasterize for Rasterizer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get metrics for font specified by FontKey
|
/// Get metrics for font specified by FontKey
|
||||||
fn metrics(&self, key: FontKey, _size: Size) -> Result<Metrics, Error> {
|
fn metrics(&self, key: FontKey) -> Result<Metrics, Error> {
|
||||||
// NOTE size is not needed here since the font loaded already contains
|
|
||||||
// it. It's part of the API due to platform differences.
|
|
||||||
let font = self.fonts
|
let font = self.fonts
|
||||||
.get(&key)
|
.get(&key)
|
||||||
.ok_or(Error::FontNotLoaded)?;
|
.ok_or(Error::FontNotLoaded)?;
|
||||||
|
|
|
@ -54,7 +54,7 @@ impl ::Rasterize for FreeTypeRasterizer {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn metrics(&self, key: FontKey, size: Size) -> Result<Metrics, Error> {
|
fn metrics(&self, key: FontKey) -> Result<Metrics, Error> {
|
||||||
let face = self.faces
|
let face = self.faces
|
||||||
.get(&key)
|
.get(&key)
|
||||||
.ok_or(Error::FontNotLoaded)?;
|
.ok_or(Error::FontNotLoaded)?;
|
||||||
|
|
|
@ -229,8 +229,8 @@ pub trait Rasterize {
|
||||||
fn new(dpi_x: f32, dpi_y: f32, device_pixel_ratio: f32, use_thin_strokes: bool) -> Result<Self, Self::Err>
|
fn new(dpi_x: f32, dpi_y: f32, device_pixel_ratio: f32, use_thin_strokes: bool) -> Result<Self, Self::Err>
|
||||||
where Self: Sized;
|
where Self: Sized;
|
||||||
|
|
||||||
/// Get `Metrics` for the given `FontKey` and `Size`
|
/// Get `Metrics` for the given `FontKey`
|
||||||
fn metrics(&self, FontKey, Size) -> Result<Metrics, Self::Err>;
|
fn metrics(&self, FontKey) -> Result<Metrics, Self::Err>;
|
||||||
|
|
||||||
/// Load the font described by `FontDesc` and `Size`
|
/// Load the font described by `FontDesc` and `Size`
|
||||||
fn load_font(&mut self, &FontDesc, Size) -> Result<FontKey, Self::Err>;
|
fn load_font(&mut self, &FontDesc, Size) -> Result<FontKey, Self::Err>;
|
||||||
|
|
|
@ -246,7 +246,7 @@ impl GlyphCache {
|
||||||
|
|
||||||
pub fn font_metrics(&self) -> font::Metrics {
|
pub fn font_metrics(&self) -> font::Metrics {
|
||||||
self.rasterizer
|
self.rasterizer
|
||||||
.metrics(self.font_key, self.font_size)
|
.metrics(self.font_key)
|
||||||
.expect("metrics load since font is loaded at glyph cache creation")
|
.expect("metrics load since font is loaded at glyph cache creation")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue