summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--font/src/ft/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs
index a4a118b9..b46b0086 100644
--- a/font/src/ft/mod.rs
+++ b/font/src/ft/mod.rs
@@ -298,7 +298,8 @@ impl FreeTypeRasterizer {
match glyph_key.c {
super::UNDERLINE_CURSOR_CHAR => {
// Get the primary face metrics
- let face = self.faces.get(&FontKey { token: 0 }).unwrap();
+ // This always loads the default face
+ let face = self.faces.get(glyph_key.font_key)?;
let size_metrics = face.ft_face
.size_metrics()
.ok_or(Error::MissingSizeMetrics)?;
@@ -314,7 +315,8 @@ impl FreeTypeRasterizer {
}
super::BEAM_CURSOR_CHAR | super::BOX_CURSOR_CHAR => {
// Get the primary face metrics
- let face = self.faces.get(&FontKey { token: 0 }).unwrap();
+ // This always loads the default face
+ let face = self.faces.get(glyph_key.font_key)?;
let size_metrics = face.ft_face
.size_metrics()
.ok_or(Error::MissingSizeMetrics)?;