feat(gui): add freetype rasterizer backend

This commit is contained in:
CJ van den Berg 2026-04-03 22:39:40 +02:00
parent 1901696b7b
commit d3aa7e17f5
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
8 changed files with 751 additions and 456 deletions

View file

@ -13,6 +13,7 @@ const builtin_shader = @import("builtin.glsl.zig");
pub const Font = Rasterizer.Font;
pub const GlyphKind = Rasterizer.GlyphKind;
pub const RasterizerBackend = Rasterizer.Backend;
pub const Cell = gui_cell.Cell;
pub const Color = gui_cell.Rgba8;
const Rgba8 = gui_cell.Rgba8;
@ -99,6 +100,14 @@ pub fn loadFont(name: []const u8, size_px: u16) !Font {
return global.rasterizer.loadFont(name, size_px);
}
pub fn setRasterizerBackend(backend: RasterizerBackend) void {
global.rasterizer.setBackend(backend);
}
pub fn setFontWeight(font: *Font, w: u8) void {
Rasterizer.setFontWeight(font, w);
}
pub fn setBackground(color: Rgba8) void {
global.background = color;
}