quirks: Menlo/Monaco should disable ligatures by default (#331)

* font: disable default font features for Menlo and Monaco

Both of these fonts have a default ligature on "fi" which makes terminal
rendering super ugly. The easiest thing to do is special-case these
fonts and disable ligatures. It appears other terminals do the same
thing.
This commit is contained in:
Mitchell Hashimoto
2023-08-25 09:29:15 -07:00
committed by GitHub
parent 63386e4a22
commit ea3b957bc7
6 changed files with 88 additions and 5 deletions

View File

@@ -83,6 +83,18 @@ pub const Face = struct {
@intFromEnum(tag),
)));
}
/// Retrieve the number of name strings in the SFNT name table.
pub fn getSfntNameCount(self: Face) usize {
return @intCast(c.FT_Get_Sfnt_Name_Count(self.handle));
}
/// Retrieve a string of the SFNT name table for a given index.
pub fn getSfntName(self: Face, i: usize) Error!c.FT_SfntName {
var name: c.FT_SfntName = undefined;
const res = c.FT_Get_Sfnt_Name(self.handle, @intCast(i), &name);
return if (intToError(res)) |_| name else |err| err;
}
};
/// An enumeration to specify indices of SFNT tables loaded and parsed by

View File

@@ -1,3 +1,5 @@
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TRUETYPE_TABLES_H
#include <freetype/ftsnames.h>
#include <freetype/ttnameid.h>