Skip to content

Commit

Permalink
Fix loading of fonts with OpenType font variations
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Feb 9, 2024
1 parent edcb60b commit 5d95b81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/renderer/fonts/font_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ impl FontPair {

let typeface = skia_font.typeface().unwrap();
let (font_data, index) = typeface.to_font_data().unwrap();
// Only the lower 16 bits are part of the index, the rest indicates named instances. But we
// don't care about those here, since we are just loading the font, so ignore them
let index = index & 0xFFFF;
let swash_font = SwashFont::from_data(font_data, index)?;

Some(Self {
Expand Down

0 comments on commit 5d95b81

Please sign in to comment.