Improve rusttype usage

This commit is contained in:
Jeremy Soller 2022-10-12 13:51:50 -06:00
parent a4959bbe7b
commit 419f2dc612
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
2 changed files with 3 additions and 3 deletions

View file

@ -56,7 +56,7 @@ impl<'a> FontMatches<'a> {
let inner = ab_glyph::GlyphId(info.glyph_id as u16);
#[cfg(feature = "rusttype")]
let inner = font.rusttype.glyph(rusttype::GlyphId(info.glyph_id as u16));
let inner = rusttype::GlyphId(info.glyph_id as u16);
#[cfg(feature = "swash")]
let inner = info.glyph_id as swash::GlyphId;

View file

@ -14,7 +14,7 @@ pub struct FontShapeGlyph<'a> {
#[cfg(feature = "ab_glyph")]
pub inner: ab_glyph::GlyphId,
#[cfg(feature = "rusttype")]
pub inner: rusttype::Glyph<'a>,
pub inner: rusttype::GlyphId,
#[cfg(feature = "swash")]
pub inner: swash::GlyphId,
}
@ -37,7 +37,7 @@ impl<'a> FontShapeGlyph<'a> {
);
#[cfg(feature = "rusttype")]
let inner = self.inner.clone()
let inner = self.font.rusttype.glyph(self.inner)
.scaled(rusttype::Scale::uniform(font_size as f32))
.positioned(rusttype::point(
x + x_offset,