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.
This commit is contained in:
parent
645100cf5f
commit
62d9174509
|
@ -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)?;
|
||||
|
|
Loading…
Reference in New Issue