From d6d7906a7a24c2aec800db90e2ad93057a82ec31 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 26 Dec 2024 18:49:28 +0530 Subject: [PATCH] Forgot a couple of octants --- kitty/decorations.c | 10 ++++++---- kitty/fonts.c | 3 ++- kitty_tests/fonts.py | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/kitty/decorations.c b/kitty/decorations.c index 6911d219b7..0aa410c4c3 100644 --- a/kitty/decorations.c +++ b/kitty/decorations.c @@ -867,7 +867,7 @@ octant_segment(Canvas *self, uint8_t which, bool left) { static void octant(Canvas *self, uint8_t which) { enum flags { a = 1, b = 2, c = 4, d = 8, m = 16, n = 32, o = 64, p = 128 }; - static const enum flags mapping[230] = { + static const enum flags mapping[232] = { // 00 - 0f b, b|m, a|b|m, n, a|n, a|m|n, b|n, a|b|n, b|m|n, c, a|c, c|m, a|c|m, a|b|c, b|c|m, a|b|c|m, // 10 - 1f @@ -898,8 +898,8 @@ octant(Canvas *self, uint8_t which) { // d0 - df a|b|d|o|p, b|d|m|o|p, ~(c|n), d|n|o|p, a|d|n|o|p, d|m|n|o|p, ~(b|c), b|d|n|o|p, ~(c|m), ~(a|c), ~c, a|c|d|o|p, c|d|m|o|p, ~(b|n), b|c|d|o|p, ~(a|n), - // e0 - e5 - ~n, c|d|n|o|p, ~(b|m), ~b, ~m, ~a, + // e0 - e7 + ~n, c|d|n|o|p, ~(b|m), ~b, ~m, ~a, b|c, n|o, }; which = mapping[which]; @@ -1787,7 +1787,9 @@ START_ALLOW_CASE_RANGE case 0x1fb28 ... 0x1fb28 + 19: sextant(c, ch - 0x1fb00 + 3); break; case 0x1fb70 ... 0x1fb70 + 5: eight_bar(c, ch - 0x1fb6f, false); break; case 0x1fb76 ... 0x1fb76 + 5: eight_bar(c, ch - 0x1fb75, true); break; - case 0x1cd00 ... 0x1cde5: octant(c, ch - 0x1cd00); true; + case 0x1fbe6: octant(c, 0xe6); break; + case 0x1fbe7: octant(c, 0xe7); break; + case 0x1cd00 ... 0x1cde5: octant(c, ch - 0x1cd00); break; } free(canvas.holes); free(canvas.y_limits); free(ss.holes); free(ss.y_limits); diff --git a/kitty/fonts.c b/kitty/fonts.c index b4d7414cf9..989f2b567a 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -724,7 +724,7 @@ START_ALLOW_CASE_RANGE case 0xe0b0 ... 0xe0bf: case 0xe0d6 ... 0xe0d7: // powerline box drawing case 0xee00 ... 0xee0b: // fira code progress bar/spinner case 0x1fb00 ... 0x1fbae: // symbols for legacy computing - case 0x1cd00 ... 0x1cde5: // octants + case 0x1cd00 ... 0x1cde5: case 0x1fbe6: case 0x1fbe7: // octants case 0xf5d0 ... 0xf60d: // branch drawing characters if (allow_use_of_box_fonts) return BOX_FONT; /* fallthrough */ @@ -764,6 +764,7 @@ START_ALLOW_CASE_RANGE return 0x1000 + ch - 0x1fb00; // IDs from 0x1000 to 0x10ae case 0x1cd00 ... 0x1cde5: return 0x1100 + ch - 0x1cd00; // IDs from 0x1100 to 0x11e5 + case 0x1fbe6: case 0x1fbe7: return 0x11e6 + ch - 0x1fbe6; case 0xf5d0 ... 0xf60d: return 0x2000 + ch - 0xf5d0; // IDs from 0x2000 to 0x203d default: diff --git a/kitty_tests/fonts.py b/kitty_tests/fonts.py index 2c613a0ea2..4396420f9f 100644 --- a/kitty_tests/fonts.py +++ b/kitty_tests/fonts.py @@ -1196,6 +1196,8 @@ def render_chr(ch: str) -> bytearray: '🮫', '🮬', '🮭', - '🮮'} # }}} + '🮮', + '\U0001fbe6', '\U0001fbe7', + } # }}} for ch in range(0x1cd00, 0x1cde5+1): # octants box_chars.add(chr(ch))