From a32278acd89a5e29774c7a03b0d11b669cfbb3fc Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Sun, 23 Jul 2023 22:19:51 +0100 Subject: [PATCH] Fix example code --- docs/wasm-shaper.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/wasm-shaper.md b/docs/wasm-shaper.md index bc3740083..77df5c6e9 100644 --- a/docs/wasm-shaper.md +++ b/docs/wasm-shaper.md @@ -506,9 +506,9 @@ pub fn shape(_shape_plan:u32, font_ref: u32, buf_ref: u32, _features: u32, _num_ let mut buffer = GlyphBuffer::from_ref(buf_ref); for mut item in buffer.glyphs.iter_mut() { // Map character to glyph - item.codepoint = font.get_glyph(codepoint, 0); + item.codepoint = font.get_glyph(item.codepoint, 0); // Set advance width - item.h_advance = font.get_glyph_h_advance(item.codepoint); + item.x_advance = font.get_glyph_h_advance(item.codepoint); } 1 }