Revert "Adjust cell height automatically for buggy fonts that draw brackets outside the bounding box"

This reverts commit 5555a66638.
Since it does not fix the issue.
This commit is contained in:
Kovid Goyal
2020-08-06 21:20:54 +05:30
parent 7f48a927de
commit 4062365b19
3 changed files with 6 additions and 11 deletions

View File

@@ -14,8 +14,6 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Fix a regression in the previous release that could cause an exception during
startup in rare circumstances (:iss:`2896`)
- Adjust cell height automatically for buggy fonts that draw brackets outside the bounding box
- Fix image leaving behind a black rectangle when switch away and back to
alternate screen (:iss:`2901`)

View File

@@ -336,7 +336,7 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
*strikethrough_thickness = *underline_thickness;
// float line_height = MAX(1, floor(self->ascent + self->descent + MAX(0, self->leading) + 0.5));
// Let CoreText's layout engine calculate the line height. Slower, but hopefully more accurate.
#define W "A{Q](WMH_gyl "
#define W "AQWMH_gyl "
CFStringRef ts = CFSTR(W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W W);
#undef W
CFMutableAttributedStringRef test_string = CFAttributedStringCreateMutable(kCFAllocatorDefault, CFStringGetLength(ts));

View File

@@ -125,14 +125,11 @@ static inline unsigned int
calc_cell_height(Face *self, bool for_metrics) {
unsigned int ans = font_units_to_pixels_y(self, self->height);
if (for_metrics) {
static const char chars[] = "_{[(";
for (unsigned i = 0; i < arraysz(chars) - 1; i++) {
unsigned int char_height = get_height_for_char(self, chars[i]);
if (char_height > ans) {
if (global_state.debug_font_fallback) printf(
"Increasing cell height by %u pixels to work around buggy font that renders '%c' outside the bounding box\n", char_height - ans, chars[i]);
ans = char_height;
}
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 ans;