Skip to content

Commit

Permalink
Forgot a couple of octants
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Dec 26, 2024
1 parent 4dbf458 commit d6d7906
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 6 additions & 4 deletions kitty/decorations.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion kitty/fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion kitty_tests/fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit d6d7906

Please sign in to comment.