Round glyph advance to integer sizes (#384)

This is in line with [1].

[1]: https://skia.googlesource.com/skia/+/refs/heads/chrome/m136/src/ports/SkTypeface_fontations.cpp#539
This commit is contained in:
mahkoh 2025-05-14 23:00:30 +02:00 committed by GitHub
parent b017d7c856
commit 987ff45ff2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1559,12 +1559,13 @@ impl ShapeLine {
_ => font_size,
};
let x_advance = glyph_font_size * glyph.x_advance
let mut x_advance = glyph_font_size * glyph.x_advance
+ if word.blank {
justification_expansion
} else {
0.0
};
x_advance = x_advance.round();
if self.rtl {
x -= x_advance;
}