macOS: no longer render emoji 20% below the baseline. This causes some emoji to be cut-off and also look misaligned with very high cells

Fixes #2873
This commit is contained in:
Kovid Goyal 2020-07-23 20:38:02 +05:30
parent 1af426bf84
commit 1bb6242020
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -58,6 +58,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- Add support for legacy DECSET codes 47, 1047 and 1048 (:pull:`2871`) - Add support for legacy DECSET codes 47, 1047 and 1048 (:pull:`2871`)
- macOS: no longer render emoji 20% below the baseline. This causes some emoji
to be cut-off and also look misaligned with very high cells (:iss:`2873`)
0.18.1 [2020-06-23] 0.18.1 [2020-06-23]
-------------------- --------------------

View File

@ -409,7 +409,7 @@ render_color_glyph(CTFontRef font, uint8_t *buf, int glyph_id, unsigned int widt
CGContextSetTextDrawingMode(ctx, kCGTextFill); CGContextSetTextDrawingMode(ctx, kCGTextFill);
CGGlyph glyph = glyph_id; CGGlyph glyph = glyph_id;
CGContextSetTextMatrix(ctx, transform); CGContextSetTextMatrix(ctx, transform);
CGContextSetTextPosition(ctx, -boxes[0].origin.x, MAX(2, height - 1.2f * baseline)); // lower the emoji a bit so its bottom is not on the baseline CGContextSetTextPosition(ctx, -boxes[0].origin.x, MAX(2, height - baseline));
CGPoint p = CGPointMake(0, 0); CGPoint p = CGPointMake(0, 0);
CTFontDrawGlyphs(font, &glyph, &p, 1, ctx); CTFontDrawGlyphs(font, &glyph, &p, 1, ctx);
CGContextRelease(ctx); CGContextRelease(ctx);