macOS: Fix a regression in the previous release that broke rendering of strikeout
The new cell height code forgot to adjust strikeout position. Fixes #3717
This commit is contained in:
parent
219bf564f7
commit
2c8f66586f
@ -4,6 +4,13 @@ Changelog
|
|||||||
|kitty| is a feature-rich, cross-platform, *fast*, GPU based terminal.
|
|kitty| is a feature-rich, cross-platform, *fast*, GPU based terminal.
|
||||||
To update |kitty|, :doc:`follow the instructions <binary>`.
|
To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||||
|
|
||||||
|
0.21.1 [future]
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
- macOS: Fix a regression in the previous release that broke rendering of
|
||||||
|
strikeout (:iss:`3717`)
|
||||||
|
|
||||||
|
|
||||||
0.21.0 [2021-06-12]
|
0.21.0 [2021-06-12]
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|||||||
@ -342,7 +342,6 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
|
|||||||
}
|
}
|
||||||
*cell_width = MAX(1u, width);
|
*cell_width = MAX(1u, width);
|
||||||
*underline_thickness = (unsigned int)ceil(MAX(0.1, self->underline_thickness));
|
*underline_thickness = (unsigned int)ceil(MAX(0.1, self->underline_thickness));
|
||||||
*strikethrough_position = (unsigned int)floor(*baseline * 0.65);
|
|
||||||
*strikethrough_thickness = *underline_thickness;
|
*strikethrough_thickness = *underline_thickness;
|
||||||
// float line_height = MAX(1, floor(self->ascent + self->descent + MAX(0, self->leading) + 0.5));
|
// 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.
|
// Let CoreText's layout engine calculate the line height. Slower, but hopefully more accurate.
|
||||||
@ -373,6 +372,7 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
|
|||||||
// Not sure if we should add this to bounds ascent and then round it or add
|
// Not sure if we should add this to bounds ascent and then round it or add
|
||||||
// it to already rounded baseline and round again.
|
// it to already rounded baseline and round again.
|
||||||
*underline_position = (unsigned int)floor(bounds_ascent - self->underline_position + 0.5);
|
*underline_position = (unsigned int)floor(bounds_ascent - self->underline_position + 0.5);
|
||||||
|
*strikethrough_position = (unsigned int)floor(*baseline * 0.65);
|
||||||
|
|
||||||
debug("Cell height calculation:\n");
|
debug("Cell height calculation:\n");
|
||||||
debug("\tline height from line origins: %f\n", line_height);
|
debug("\tline height from line origins: %f\n", line_height);
|
||||||
@ -381,7 +381,7 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
|
|||||||
debug("\tbounds metrics: ascent: %f\n", bounds_ascent);
|
debug("\tbounds metrics: ascent: %f\n", bounds_ascent);
|
||||||
debug("\tline metrics: ascent: %f descent: %f leading: %f\n", typographic_ascent, typographic_descent, typographic_leading);
|
debug("\tline metrics: ascent: %f descent: %f leading: %f\n", typographic_ascent, typographic_descent, typographic_leading);
|
||||||
debug("\tfont metrics: ascent: %f descent: %f leading: %f underline_position: %f\n", self->ascent, self->descent, self->leading, self->underline_position);
|
debug("\tfont metrics: ascent: %f descent: %f leading: %f underline_position: %f\n", self->ascent, self->descent, self->leading, self->underline_position);
|
||||||
debug("\tcell_height: %u baseline: %u underline_position: %u\n", *cell_height, *baseline, *underline_position);
|
debug("\tcell_height: %u baseline: %u underline_position: %u strikethrough_position: %u\n", *cell_height, *baseline, *underline_position, *strikethrough_position);
|
||||||
|
|
||||||
CFRelease(test_frame); CFRelease(path); CFRelease(framesetter);
|
CFRelease(test_frame); CFRelease(path); CFRelease(framesetter);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user