Add some more box-drawing characters from the "Geometric shapes" Unicode block

Fixes #7433
This commit is contained in:
Kovid Goyal 2024-05-15 09:27:32 +05:30
parent 98624d614e
commit 3345e40bdb
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 23 additions and 5 deletions

View file

@ -80,6 +80,8 @@ Detailed list of changes
- Allow more types of alignment for :opt:`placement_strategy` (:pull:`7419`)
- Add some more box-drawing characters from the "Geometric shapes" Unicode block (:iss:`7433`)
0.34.1 [2024-04-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -575,6 +575,9 @@ START_ALLOW_CASE_RANGE
return BLANK_FONT;
case 0x2500 ... 0x2573:
case 0x2574 ... 0x259f:
case 0x25d6 ... 0x25d7:
case 0x25cb:
case 0x25dc ... 0x25e5:
case 0x2800 ... 0x28ff:
case 0xe0b0 ... 0xe0bf: // powerline box drawing
case 0xee00 ... 0xee0b: // fira code progress bar/spinner
@ -611,14 +614,14 @@ static glyph_index
box_glyph_id(char_type ch) {
START_ALLOW_CASE_RANGE
switch(ch) {
case 0x2500 ... 0x259f:
return ch - 0x2500; // IDs from 0x00 to 0x9f
case 0x2500 ... 0x25ff:
return ch - 0x2500; // IDs from 0x00 to 0xff
case 0xe0b0 ... 0xee0b:
return 0xa0 + ch - 0xe0b0; // IDs from 0xa0 to 0xd58
return 0x100 + ch - 0xe0b0; // IDs from 0x100 to 0xe5b
case 0x2800 ... 0x28ff:
return 0xe00 + ch - 0x2800; // IDs from 0xe00 to 0xeff
return 0xf00 + ch - 0x2800; // IDs from 0xf00 to 0xfff
case 0x1fb00 ... 0x1fbae:
return 0xf00 + ch - 0x1fb00; // IDs from 0xf00 to 0xfae
return 0x1000 + ch - 0x1fb00; // IDs from 0x1000 to 0x10ae
default:
return 0xffff;
}

View file

@ -1015,16 +1015,22 @@ def braille(buf: BufType, width: int, height: int, which: int = 0) -> None:
'': [p(triangle, left=False)],
'': [p(half_cross_line, which='tr'), p(half_cross_line, which='br')],
'': [D],
'': [D],
'': [rounded_separator],
'': [p(D, left=False)],
'': [p(D, left=False)],
'': [p(rounded_separator, left=False)],
'': [p(corner_triangle, corner='bottom-left')],
'': [p(corner_triangle, corner='bottom-left')],
'': [cross_line],
'': [p(corner_triangle, corner='bottom-right')],
'': [p(corner_triangle, corner='bottom-right')],
'': [p(cross_line, left=False)],
'': [p(corner_triangle, corner='top-left')],
'': [p(corner_triangle, corner='top-left')],
'': [p(cross_line, left=False)],
'': [p(corner_triangle, corner='top-right')],
'': [p(corner_triangle, corner='top-right')],
'': [cross_line],
'': [p(progress_bar, which='l')],
'': [p(progress_bar, which='m')],
@ -1038,6 +1044,13 @@ def braille(buf: BufType, width: int, height: int, which: int = 0) -> None:
'': [p(spinner, start=360, end=540)],
'': [p(spinner, start=80, end=220)],
'': [p(spinner, start=170, end=270)],
'': [p(spinner, start=0, end=360)], # circle
'': [p(spinner, start=180, end=270)], # upper-left
'': [p(spinner, start=270, end=360)], # upper-right
'': [p(spinner, start=360, end=450)], # lower-right
'': [p(spinner, start=450, end=540)], # lower-left
'': [p(spinner, start=180, end=360)], # upper-half
'': [p(spinner, start=0, end=180)], # lower-half
'': [dhline],
'': [dvline],