From 926f8a326e42b557d2991bddf5e234289677c362 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 23 Feb 2023 15:52:13 -0700 Subject: [PATCH] [wasm-sample] Actually shape text! --- src/wasm-sample/shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wasm-sample/shape.c b/src/wasm-sample/shape.c index c558114c9..69efaca93 100644 --- a/src/wasm-sample/shape.c +++ b/src/wasm-sample/shape.c @@ -25,8 +25,8 @@ shape (font_t *font, buffer_t *buffer) for (unsigned i = 0; i < contents.length; i++) { debugprint2 ("Codepoint", i, contents.info[i].codepoint); - contents.info[i].codepoint++; - contents.pos[i].x_advance = 256 * 64; + contents.info[i].codepoint = font_get_glyph (font, contents.info[i].codepoint, 0); + contents.pos[i].x_advance = font_get_glyph_h_advance (font, contents.info[i].codepoint); } bool_t ret = buffer_set_contents (buffer, &contents);