diff --git a/sugarloaf/src/components/rich_text/image_cache/glyph.rs b/sugarloaf/src/components/rich_text/image_cache/glyph.rs index ac4bb1aa56..8ae2862891 100644 --- a/sugarloaf/src/components/rich_text/image_cache/glyph.rs +++ b/sugarloaf/src/components/rich_text/image_cache/glyph.rs @@ -103,6 +103,7 @@ pub struct GlyphCacheSession<'a> { scaler: Scaler<'a>, scaled_image: &'a mut GlyphImage, quant_size: u16, + #[allow(unused)] max_height: &'a u16, } @@ -151,8 +152,8 @@ impl<'a> GlyphCacheSession<'a> { }; let image = self.images.allocate(req)?; - let mut top = p.top; - let mut height = h; + // let mut top = p.top; + // let mut height = h; // If dimension is None it means that we are running // for the first time and in this case, we will obtain @@ -165,18 +166,18 @@ impl<'a> GlyphCacheSession<'a> { // If the rect max height is 50 and the glyph height is 68 // and 48 top, then (68 - 50 = 18) height as difference and // apply it to the top (bigger the top == up ^). - if self.max_height > &0 && &h > self.max_height { - let difference = h - self.max_height; + // if self.max_height > &0 && &h > self.max_height { + // let difference = h - self.max_height; - top -= difference as i32; - height = *self.max_height; - } + // top -= difference as i32; + // height = *self.max_height; + // } let entry = GlyphEntry { left: p.left, - top, + top: p.top, width: w, - height, + height: h, image, is_bitmap: self.scaled_image.content == Content::Color, }; diff --git a/sugarloaf/src/font_introspector/internal/head.rs b/sugarloaf/src/font_introspector/internal/head.rs index 25126b6f7e..299774b3a5 100644 --- a/sugarloaf/src/font_introspector/internal/head.rs +++ b/sugarloaf/src/font_introspector/internal/head.rs @@ -278,12 +278,8 @@ impl<'a> Os2<'a> { /// Returns a four character font vendor identifier. pub fn vendor_id(&self) -> &'a str { - core::str::from_utf8( - self.0 - .read_bytes(58, 4) - .unwrap_or(&[b'n', b'o', b'n', b'e']), - ) - .unwrap_or("none") + core::str::from_utf8(self.0.read_bytes(58, 4).unwrap_or(b"none")) + .unwrap_or("none") } /// Returns the font selection bit flags.