diff options
author | Christian Dürr <contact@christianduerr.com> | 2017-12-24 13:43:42 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-24 09:46:54 -0800 |
commit | 62d9174509059460262ce458b622d87d1562d406 (patch) | |
tree | f73a2a4a0cd608f45e90dd4427536a6d57a91342 | |
parent | 645100cf5f62448d43a43bf3799911461c2bdd9e (diff) | |
download | alacritty-62d9174509059460262ce458b622d87d1562d406.tar.gz alacritty-62d9174509059460262ce458b622d87d1562d406.zip |
Use font_key provided with cursor glyphs
Previously it was assumed that the font_key for the normal font is
always 0, because this assumption was a bit of a stretch, now the
font_key provided with the glyph is used. This is always the bold,
italics or normal font associated with the cell.
-rw-r--r-- | font/src/ft/mod.rs | 6 |
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)?; |