Skip to content

Commit

Permalink
swrenderer: round the advance instead of truncating it in distance field
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart committed Nov 21, 2024
1 parent f18ed22 commit b60646b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/core/software_renderer/fonts/pixelfont.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ impl TextShaper for PixelFont {
let x_advance = glyph_index.map_or_else(
|| self.pixel_size,
|glyph_index| {
(self.pixel_size.cast() * self.glyphs.glyph_data[glyph_index].x_advance as i32
((self.pixel_size.cast()
* self.glyphs.glyph_data[glyph_index].x_advance as i32
/ self.glyphs.pixel_size as i32
+ euclid::Length::new(32))
/ 64)
.cast()
},
Expand Down

0 comments on commit b60646b

Please sign in to comment.