Skip to content

Commit

Permalink
Fix kerning when drawing text
Browse files Browse the repository at this point in the history
  • Loading branch information
staticintlucas committed Dec 23, 2023
1 parent b732336 commit 165be05
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keyset-drawing/src/imp/legend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ pub fn draw(
let mut pos = first.advance;

for (lhs, rhs) in legend.text.chars().zip(chars) {
pos += font.kerning(lhs, rhs);
let Glyph { path, advance, .. } = font.glyph_or_default(rhs);
text_path.extend(Affine::translate((pos, 0.0)) * path);
pos += advance + font.kerning(lhs, rhs);
pos += advance;
}

let height = profile.text_height.get(legend.size_idx);
Expand Down

0 comments on commit 165be05

Please sign in to comment.