Add support for swash
This commit is contained in:
parent
51639e53cb
commit
cf43655357
7 changed files with 116 additions and 66 deletions
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue