From 6476a1d2e0af58b16ededff8657dcece87fad00b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 12 Jul 2020 21:05:39 +0530 Subject: [PATCH] When a character from the Unicode Dingbat block is followed by a space, use the extra space to render a larger version of the character Fixes #2850 --- docs/changelog.rst | 3 +++ kitty/fonts.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index c024756db..35d584d5c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,6 +17,9 @@ To update |kitty|, :doc:`follow the instructions `. - Implement support for box drawing rounded-corners characters (:iss:`2240`) +- When a character from the Unicode Dingbat block is followed by a space, use + the extra space to render a larger version of the character (:iss:`2850`) + - macOS: Fix the LC_TYPE env var being set to UTF-8 on systems in which the language and country code do not form a valid locale (:iss:`1233`) diff --git a/kitty/fonts.c b/kitty/fonts.c index d1a3355d5..1ac4ae901 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -1132,6 +1132,11 @@ render_run(FontGroup *fg, CPUCell *first_cpu_cell, GPUCell *first_gpu_cell, inde } } +static inline bool +is_non_emoji_dingbat(char_type ch) { + return 0x2700 <= ch && ch <= 0x27bf && !is_emoji(ch); +} + void render_line(FONTS_DATA_HANDLE fg_, Line *line, index_type lnum, Cursor *cursor, DisableLigature disable_ligature_strategy) { #define RENDER if (run_font_idx != NO_FONT && i > first_cell_in_run) { \ @@ -1154,7 +1159,7 @@ render_line(FONTS_DATA_HANDLE fg_, Line *line, index_type lnum, Cursor *cursor, if ( cell_font_idx != MISSING_FONT && - ((is_fallback_font && !is_emoji_presentation && is_symbol(cpu_cell->ch)) || (cell_font_idx != BOX_FONT && is_private_use(cpu_cell->ch))) + ((is_fallback_font && !is_emoji_presentation && is_symbol(cpu_cell->ch)) || (cell_font_idx != BOX_FONT && (is_private_use(cpu_cell->ch))) || is_non_emoji_dingbat(cpu_cell->ch)) ) { unsigned int desired_cells = 1; if (cell_font_idx > 0) {