From 5383cd9c9c202dc828684c227b3a3df2ec67d580 Mon Sep 17 00:00:00 2001 From: Qwerasd Date: Sun, 10 Aug 2025 16:04:54 -0600 Subject: [PATCH] font/freetype: pass monochrome load flag when needed The monochrome hinter is very aggressive but makes text actually look tolerable when rendered in monochrome. If for some god forsaken reason we get complaints about this, that someone wanted improperly hinted mono glyphs, we can introduce additonal configuration; but for now, this is just a straight improvement. --- src/font/face/freetype.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/font/face/freetype.zig b/src/font/face/freetype.zig index 2ceac42ab..dbaa6ab59 100644 --- a/src/font/face/freetype.zig +++ b/src/font/face/freetype.zig @@ -356,6 +356,11 @@ pub const Face = struct { .force_autohint = self.load_flags.@"force-autohint", .no_autohint = !self.load_flags.autohint, + // If we're gonna be rendering this glyph in monochrome, + // then we should use the monochrome hinter as well, or + // else it won't look very good at all. + .target_mono = self.load_flags.monochrome, + // NO_SVG set to true because we don't currently support rendering // SVG glyphs under FreeType, since that requires bundling another // dependency to handle rendering the SVG.