Add support for swash

This commit is contained in:
Jeremy Soller 2022-10-07 09:41:36 -06:00
parent 51639e53cb
commit cf43655357
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
7 changed files with 116 additions and 66 deletions

View file

@ -40,6 +40,9 @@ impl<'a> FontMatches<'a> {
#[cfg(feature = "rusttype")]
let inner = font.rusttype.glyph(rusttype::GlyphId(info.glyph_id as u16));
#[cfg(feature = "swash")]
let inner = info.glyph_id as swash::GlyphId;
glyphs.push(FontShapeGlyph {
start: start_word + info.cluster as usize,
end: end_word, // Set later
@ -49,6 +52,8 @@ impl<'a> FontMatches<'a> {
y_offset,
#[cfg(feature = "ab_glyph")]
font: &font.ab_glyph,
#[cfg(feature = "swash")]
font: &font.swash,
inner,
});
}