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

See https://github.com/cormullion/juliamono/issues/14
This commit is contained in:
Kovid Goyal
2020-08-06 14:06:06 +05:30
parent dad355b932
commit 5555a66638
3 changed files with 11 additions and 6 deletions

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 "AQWMH_gyl "
#define W "A{Q](WMH_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));