confirmed that the descender emoji thing is macos specific

so let's avoid doing it on linux and windows
This commit is contained in:
Wez Furlong committed 2019-10-27 15:20:18 -07:00
1 parent a0f6db85cb
commit 91b56abb3a
1 file changed
+7 -3
+7 -3
View File
@@ -249,12 +249,16 @@ impl Font for FreeTypeFontImpl {
bearing_x: (f64::from(ft_glyph.bitmap_left)
* (dest_width as f64 / width as f64)),
// Fudge alert: this may be font specific, but I've found
// Fudge alert: this is font specific: I've found
// that the emoji font on macOS doesn't account for the
// descender in its metrics, so we're adding that offset
// here to avoid rendering the glyph too high
bearing_y: descender
+ (f64::from(ft_glyph.bitmap_top) * (dest_height as f64 / height as f64)),
bearing_y: if cfg!(target_os = "macos") {
descender
} else {
0.
} + (f64::from(ft_glyph.bitmap_top)
* (dest_height as f64 / height as f64)),
}
}
ftwrap::FT_Pixel_Mode::FT_PIXEL_MODE_GRAY => {