mirror of
https://github.com/alacritty/alacritty.git
synced 2026-11-25 15:15:51 +03:00
Fix freetype 26.6 format conversion
This resolves a rounding issue when converting to the 26.6 format used by freetype for character sizes. This rounding behavior is taken from cairo: https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/src/cairo-ft-font.c#L900-903 There are various different implementations of the F26Dot6 conversion online, but the rounding that cairo does seems to be the most common. Since cairo is very commonly used, it should produce good results compared with the rest of Linux text rendering. Fixes #2780. Co-authored-by: Christian Duerr <contact@christianduerr.com> Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This commit is contained in:
2 files changed
+2
-1
No files matched your search
@@ -71,6 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fontconfig's `autohint` and `hinting` options being ignored
|
||||
- Ingoring of default FreeType properties
|
||||
- Alacritty crashing at startup when the configured font does not exist
|
||||
- Font size rounding error
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ pub struct FreeTypeRasterizer {
|
||||
|
||||
#[inline]
|
||||
fn to_freetype_26_6(f: f32) -> isize {
|
||||
((1i32 << 6) as f32 * f) as isize
|
||||
((1i32 << 6) as f32 * f).round() as isize
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
||||
Reference in new issue
Block a user