fix font loading

This commit is contained in:
Gabriel Dinner-David
2024-11-23 13:41:41 -05:00
parent fa24e0482b
commit b90eef7861
2 changed files with 2 additions and 5 deletions

View File

@ -57,7 +57,7 @@ fetch(url.href)
};
// Create our config
const config_str = makeStr("font-family = monospace\nfont-size 32\n");
const config_str = makeStr("font-family = monospace\nfont-size = 32\n");
old(results);
run(config_str.ptr, config_str.len);
})

View File

@ -30,18 +30,15 @@ fn run_(str: []const u8) !void {
var config = try Config.default(alloc);
var fbs = std.io.fixedBufferStream(str);
var iter = cli.args.lineIterator(fbs.reader());
try cli.args.parse(Config, alloc, &config, &iter);
try config.loadIter(alloc, &iter);
try config.finalize();
std.log.err("font-size {}", .{config.@"font-size"});
config.@"font-size" = 32;
std.log.err("font-size {}", .{config.@"font-size"});
const app = try App.create(alloc);
// Create our runtime app
var app_runtime = try apprt.App.init(app, .{});
const surface = try alloc.create(Surface);
const apprt_surface = try alloc.create(apprt.Surface);
try surface.init(alloc, &config, app, &app_runtime, apprt_surface);
try surface.updateConfig(&config);
std.log.err("{}", .{surface.size});
try surface.renderer.setScreenSize(surface.size);
const esc = "\x1b[";