examples/gkurve: improve compatibility with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-26 19:21:27 -07:00
parent a4792f6e5a
commit eb5149a7bb

View file

@ -75,10 +75,10 @@ fn write(ctx: WriterContext, bytes: []const u8) WriterError!usize {
if (!v.found_existing) { if (!v.found_existing) {
try ctx.label.face.setCharSize(ctx.label.size * 64, 0, 50, 0); try ctx.label.face.setCharSize(ctx.label.size * 64, 0, 50, 0);
try ctx.label.face.loadChar(char, .{ .render = true }); try ctx.label.face.loadChar(char, .{ .render = true });
const glyph = ctx.label.face.glyph; const glyph = ctx.label.face.glyph();
v.value_ptr.* = GlyphInfo{ v.value_ptr.* = GlyphInfo{
.uv_data = undefined, .uv_data = undefined,
.metrics = glyph().metrics(), .metrics = glyph.metrics(),
}; };
} }
offset[0] += @intToFloat(f32, v.value_ptr.metrics.horiAdvance >> 6); offset[0] += @intToFloat(f32, v.value_ptr.metrics.horiAdvance >> 6);