mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 01:17:34 +03:00
Linux: Fix incorrect scaling for fallback fonts when the font has an underscore that renders out of bounds
The calc_cell_height() function should not use underscore heights when called in contexts other than cell metrics calculation. Fixes #1713
This commit is contained in:
parent
0be6c9cb97
commit
cde69670ba
@ -29,6 +29,10 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
- macOS: Reduce energy consumption when idle by shutting down Apple's display
|
||||
link thread after 30 second of inactivity (:iss:`1763`)
|
||||
|
||||
- Linux: Fix incorrect scaling for fallback fonts when the font has an
|
||||
underscore that renders out of bounds (:iss:`1713`)
|
||||
|
||||
|
||||
0.14.2 [2019-06-09]
|
||||
---------------------
|
||||
|
||||
|
@ -123,11 +123,15 @@ get_height_for_char(Face *self, char ch) {
|
||||
static inline unsigned int
|
||||
calc_cell_height(Face *self, bool for_metrics) {
|
||||
unsigned int ans = font_units_to_pixels_y(self, self->height);
|
||||
unsigned int underscore_height = get_height_for_char(self, '_');
|
||||
if (for_metrics && global_state.debug_font_fallback && underscore_height > ans) {
|
||||
printf("Increasing cell height by %u pixels to work around buggy font that renders underscore outside the bounding box\n", underscore_height - ans);
|
||||
if (for_metrics) {
|
||||
unsigned int underscore_height = get_height_for_char(self, '_');
|
||||
if (underscore_height > ans) {
|
||||
if (global_state.debug_font_fallback) printf(
|
||||
"Increasing cell height by %u pixels to work around buggy font that renders underscore outside the bounding box\n", underscore_height - ans);
|
||||
return underscore_height;
|
||||
}
|
||||
}
|
||||
return MAX(ans, underscore_height);
|
||||
return ans;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user