diff --git a/CHANGELOG.md b/CHANGELOG.md index a67a8303..2e9019f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Incorrect selection status of the first cell when selection is off screen - Backwards bracket selection - Stack overflow when printing shader creation error +- Underline position for bitmap fonts ### Removed diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs index 5bc353ff..796abe6e 100644 --- a/alacritty/src/renderer/rects.rs +++ b/alacritty/src/renderer/rects.rs @@ -86,7 +86,7 @@ impl RenderLine { let line_bottom = (start.line.0 as f32 + 1.) * size.cell_height; let baseline = line_bottom + metrics.descent; - let mut y = baseline - position - height / 2.; + let mut y = (baseline - position - height / 2.).ceil(); let max_y = line_bottom - height; if y > max_y { y = max_y; diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 5c5c4a73..f91acd03 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -108,7 +108,7 @@ impl Rasterize for FreeTypeRasterizer { // Fallback for bitmap fonts which do not provide underline metrics if underline_position == 0. { - underline_thickness = (descent / 5.).round(); + underline_thickness = (descent.abs() / 5.).round(); underline_position = descent / 2.; }