summaryrefslogtreecommitdiff
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/text.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/layout/text.rs b/src/layout/text.rs
index 75a59254..6aa5ef71 100644
--- a/src/layout/text.rs
+++ b/src/layout/text.rs
@@ -32,7 +32,7 @@ pub fn layout(text: &str, ctx: TextContext) -> LayoutResult<BoxLayout> {
}).ok_or_else(|| LayoutError::NoSuitableFont(character))?;
// Add the char width to the total box width.
- let char_width = font.widths[font.map(character) as usize] * ctx.style.font_size;
+ let char_width = font.widths[font.encode(character) as usize] * ctx.style.font_size;
width += char_width;
// Change the font if necessary.