Use scalable check rather than fixed size check for setting char size

This commit is contained in:
Mitchell Hashimoto
2022-10-16 20:55:06 -07:00
parent 2e1bc7bb01
commit a39fe6baed
2 changed files with 2 additions and 2 deletions

View File

@ -1902,7 +1902,7 @@ pub fn invokeCharset(
self.terminal.invokeCharset(active, slot, single);
}
const face_ttf = @embedFile("font/res/Monaco-Regular.ttf");
const face_ttf = @embedFile("font/res/FiraCode-Regular.ttf");
const face_bold_ttf = @embedFile("font/res/FiraCode-Bold.ttf");
const face_emoji_ttf = @embedFile("font/res/NotoColorEmoji.ttf");
const face_emoji_text_ttf = @embedFile("font/res/NotoEmoji-Regular.ttf");

View File

@ -80,7 +80,7 @@ pub const Face = struct {
// If we have fixed sizes, we just have to try to pick the one closest
// to what the user requested. Otherwise, we can choose an arbitrary
// pixel size.
if (!face.hasFixedSizes()) {
if (face.isScalable()) {
const size_26dot6 = @intCast(i32, size.points << 6); // mult by 64
try face.setCharSize(0, size_26dot6, size.xdpi, size.ydpi);
} else try selectSizeNearest(face, size.pixels());