diff --git a/src/main.zig b/src/main.zig index 5ecd118..9f2a3ad 100644 --- a/src/main.zig +++ b/src/main.zig @@ -14,20 +14,22 @@ pub fn main() !void { rl.InitWindow(800, 600, "Testing Raylib"); defer rl.CloseWindow(); - // const font = blk: { - // const maybeFont = rl.LoadFontEx("./db.ttf", 64, null, 0); - // if (std.meta.eql(maybeFont, rl.GetFontDefault())) { - // break :blk null; - // } - // break :blk maybeFont; - // }; + const font = blk: { + var cp_cnt: c_int = 0; + const cp = rl.LoadCodepoints("aäbcdeèéfghijklmnoöpqrsßtuüvwxyzAÄBCDEÈÉFGHIJKLMNOÖPQRSẞTUÜVWXYZ0123456789-_,()/\\:+", &cp_cnt,); + const maybeFont = rl.LoadFontEx("./db.ttf", 64, cp, cp_cnt); + if (std.meta.eql(maybeFont, rl.GetFontDefault())) { + break :blk null; + } + break :blk maybeFont; + }; var station_name_buffer: [100]u8 = .{0} ** 100; var platform_buffer: [20]u8 = .{0} ** 20; var station_id_buffer: [10]u8 = .{0} ** 10; var appState = AppState{ .allocator = allocator, - // .db_font = font, + .db_font = font, .home_screen_state = .{ .station_name = std.ArrayListUnmanaged(u8).initBuffer(&station_name_buffer), },