diff --git a/example/app.ts b/example/app.ts index 696d1d17a..4026bbc04 100644 --- a/example/app.ts +++ b/example/app.ts @@ -55,6 +55,7 @@ fetch(url.href).then(response => for (let i = 33; i <= 126; i++) { face_render_glyph(face, atlas, i); } + //face_render_glyph(face, atlas, "橋".codePointAt(0)); //face_render_glyph(face, atlas, "p".codePointAt(0)); // Debug our canvas diff --git a/src/font/Atlas.zig b/src/font/Atlas.zig index db73f1e90..f38af41df 100644 --- a/src/font/Atlas.zig +++ b/src/font/Atlas.zig @@ -392,7 +392,7 @@ pub const Wasm = struct { // This will return the same context on subsequent calls so it // is important to reset it. const ctx = try canvas.call(js.Object, "getContext", .{js.string("2d")}); - errdefer ctx.deinit(); + defer ctx.deinit(); // We need to draw pixels so this is format dependent. var buf: []u8 = switch (self.format) { diff --git a/src/font/face/web_canvas.zig b/src/font/face/web_canvas.zig index addac8763..6f5e86a2d 100644 --- a/src/font/face/web_canvas.zig +++ b/src/font/face/web_canvas.zig @@ -163,7 +163,6 @@ pub const Face = struct { }); // Draw glyph - // TODO: may need a +1 on the left/asc here to avoid clipping try ctx.set("fillStyle", js.string("black")); try ctx.call(void, "fillText", .{ glyph_str,