mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
@ -23,6 +23,13 @@ pub const Slant = enum(c_uint) {
|
|||||||
oblique = c.FC_SLANT_OBLIQUE,
|
oblique = c.FC_SLANT_OBLIQUE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const Spacing = enum(c_uint) {
|
||||||
|
proportional = c.FC_PROPORTIONAL,
|
||||||
|
dual = c.FC_DUAL,
|
||||||
|
mono = c.FC_MONO,
|
||||||
|
charcell = c.FC_CHARCELL,
|
||||||
|
};
|
||||||
|
|
||||||
pub const Property = enum {
|
pub const Property = enum {
|
||||||
family,
|
family,
|
||||||
style,
|
style,
|
||||||
|
@ -139,6 +139,15 @@ pub const Descriptor = struct {
|
|||||||
false,
|
false,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// For fontconfig, we always add monospace in the pattern. Since
|
||||||
|
// fontconfig sorts by closeness to the pattern, this doesn't fully
|
||||||
|
// exclude non-monospace but helps prefer it.
|
||||||
|
assert(pat.add(
|
||||||
|
.spacing,
|
||||||
|
.{ .integer = @intFromEnum(fontconfig.Spacing.mono) },
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
|
||||||
return pat;
|
return pat;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,7 +286,7 @@ pub const Fontconfig = struct {
|
|||||||
if (res.result != .match) return error.FontConfigFailed;
|
if (res.result != .match) return error.FontConfigFailed;
|
||||||
errdefer res.fs.destroy();
|
errdefer res.fs.destroy();
|
||||||
|
|
||||||
return DiscoverIterator{
|
return .{
|
||||||
.config = self.fc_config,
|
.config = self.fc_config,
|
||||||
.pattern = pat,
|
.pattern = pat,
|
||||||
.set = res.fs,
|
.set = res.fs,
|
||||||
|
Reference in New Issue
Block a user