From 1bb6242020168ab0e9f4028d1a096030911db77c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 23 Jul 2020 20:38:02 +0530 Subject: [PATCH] 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 --- docs/changelog.rst | 3 +++ kitty/core_text.m | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a3044deb2..008788e53 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -58,6 +58,9 @@ To update |kitty|, :doc:`follow the instructions `. - 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] -------------------- diff --git a/kitty/core_text.m b/kitty/core_text.m index 5da81b2ea..5606df8ed 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -409,7 +409,7 @@ render_color_glyph(CTFontRef font, uint8_t *buf, int glyph_id, unsigned int widt CGContextSetTextDrawingMode(ctx, kCGTextFill); CGGlyph glyph = glyph_id; 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); CTFontDrawGlyphs(font, &glyph, &p, 1, ctx); CGContextRelease(ctx);