Improve rusttype usage
This commit is contained in:
parent
a4959bbe7b
commit
419f2dc612
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue