fix(pkg/freetype): fully correct load flags

These now properly match the FreeType API- compared directly in the unit
tests against the values provided by the FreeType header itself.

This was ridiculously wrong before, like... wow.
This commit is contained in:
Qwerasd
2025-11-24 17:42:02 -07:00
parent 3cd6939af6
commit 6d65abc489
2 changed files with 19 additions and 15 deletions

View File

@@ -376,11 +376,15 @@ pub const Face = struct {
// 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,
// Otherwise we select hinter based on the `light` flag.
.target_normal = !self.load_flags.light and !self.load_flags.monochrome,
.target_light = self.load_flags.light and !self.load_flags.monochrome,
//
// Otherwise if the user asked for light hinting we
// use that, otherwise we just use the normal target.
.target = if (self.load_flags.monochrome)
.mono
else if (self.load_flags.light)
.light
else
.normal,
// NO_SVG set to true because we don't currently support rendering
// SVG glyphs under FreeType, since that requires bundling another