address review: Discover.init takes a Library across all backends

Per review feedback, drop the `if (Discover == Windows)` comptime
branches in SharedGridSet and list_fonts by making every backend's
`init` take a Library and ignore it when unused. Call sites just do
`Discover.init(self.font_lib)` now.

Also adds a discovery test for the Windows backend that looks up
Arial and checks the returned face has the 'A' codepoint.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yasuhiro Matsumoto
2026-04-23 23:06:21 +09:00
parent fe2a909782
commit 5aef2541b0
3 changed files with 52 additions and 24 deletions

View File

@@ -442,10 +442,7 @@ fn discover(self: *SharedGridSet) !?*Discover {
// If we initialized, use it
if (self.font_discover) |*v| return v;
self.font_discover = if (comptime Discover == discovery.Windows)
.init(self.font_lib)
else
.init();
self.font_discover = .init(self.font_lib);
return &self.font_discover.?;
}