mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
render: fix order we're checking custom codepoints
Fixes a crash when trying to print a "Legacy Computing" symbol (U+1FB00-U+1FB9B). Closes #1901
This commit is contained in:
parent
9cde179034
commit
f5c10a2452
3 changed files with 18 additions and 11 deletions
|
|
@ -72,6 +72,13 @@
|
||||||
### Deprecated
|
### Deprecated
|
||||||
### Removed
|
### Removed
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
* Regression: trying to print a Unicode _"Legacy Computing symbol"_,
|
||||||
|
in the range U+1FB00 - U+1FB9B would crash foot ([#][]).
|
||||||
|
|
||||||
|
[1901]: https://codeberg.org/dnkl/foot/issues/1901
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
|
|
|
||||||
10
render.c
10
render.c
|
|
@ -817,14 +817,14 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag
|
||||||
size_t count;
|
size_t count;
|
||||||
size_t idx;
|
size_t idx;
|
||||||
|
|
||||||
if (base >= GLYPH_OCTANTS_FIRST) {
|
if (base >= GLYPH_LEGACY_FIRST) {
|
||||||
arr = &term->custom_glyphs.octants;
|
|
||||||
count = GLYPH_OCTANTS_COUNT;
|
|
||||||
idx = base - GLYPH_OCTANTS_FIRST;
|
|
||||||
} else if (base >= GLYPH_LEGACY_FIRST) {
|
|
||||||
arr = &term->custom_glyphs.legacy;
|
arr = &term->custom_glyphs.legacy;
|
||||||
count = GLYPH_LEGACY_COUNT;
|
count = GLYPH_LEGACY_COUNT;
|
||||||
idx = base - GLYPH_LEGACY_FIRST;
|
idx = base - GLYPH_LEGACY_FIRST;
|
||||||
|
} else if (base >= GLYPH_OCTANTS_FIRST) {
|
||||||
|
arr = &term->custom_glyphs.octants;
|
||||||
|
count = GLYPH_OCTANTS_COUNT;
|
||||||
|
idx = base - GLYPH_OCTANTS_FIRST;
|
||||||
} else if (base >= GLYPH_BRAILLE_FIRST) {
|
} else if (base >= GLYPH_BRAILLE_FIRST) {
|
||||||
arr = &term->custom_glyphs.braille;
|
arr = &term->custom_glyphs.braille;
|
||||||
count = GLYPH_BRAILLE_COUNT;
|
count = GLYPH_BRAILLE_COUNT;
|
||||||
|
|
|
||||||
12
terminal.h
12
terminal.h
|
|
@ -482,8 +482,8 @@ struct terminal {
|
||||||
struct {
|
struct {
|
||||||
struct fcft_glyph **box_drawing;
|
struct fcft_glyph **box_drawing;
|
||||||
struct fcft_glyph **braille;
|
struct fcft_glyph **braille;
|
||||||
struct fcft_glyph **legacy;
|
|
||||||
struct fcft_glyph **octants;
|
struct fcft_glyph **octants;
|
||||||
|
struct fcft_glyph **legacy;
|
||||||
|
|
||||||
#define GLYPH_BOX_DRAWING_FIRST 0x2500
|
#define GLYPH_BOX_DRAWING_FIRST 0x2500
|
||||||
#define GLYPH_BOX_DRAWING_LAST 0x259F
|
#define GLYPH_BOX_DRAWING_LAST 0x259F
|
||||||
|
|
@ -495,15 +495,15 @@ struct terminal {
|
||||||
#define GLYPH_BRAILLE_COUNT \
|
#define GLYPH_BRAILLE_COUNT \
|
||||||
(GLYPH_BRAILLE_LAST - GLYPH_BRAILLE_FIRST + 1)
|
(GLYPH_BRAILLE_LAST - GLYPH_BRAILLE_FIRST + 1)
|
||||||
|
|
||||||
#define GLYPH_LEGACY_FIRST 0x1FB00
|
|
||||||
#define GLYPH_LEGACY_LAST 0x1FB9B
|
|
||||||
#define GLYPH_LEGACY_COUNT \
|
|
||||||
(GLYPH_LEGACY_LAST - GLYPH_LEGACY_FIRST + 1)
|
|
||||||
|
|
||||||
#define GLYPH_OCTANTS_FIRST 0x1CD00
|
#define GLYPH_OCTANTS_FIRST 0x1CD00
|
||||||
#define GLYPH_OCTANTS_LAST 0x1CDE5
|
#define GLYPH_OCTANTS_LAST 0x1CDE5
|
||||||
#define GLYPH_OCTANTS_COUNT \
|
#define GLYPH_OCTANTS_COUNT \
|
||||||
(GLYPH_OCTANTS_LAST - GLYPH_OCTANTS_FIRST + 1)
|
(GLYPH_OCTANTS_LAST - GLYPH_OCTANTS_FIRST + 1)
|
||||||
|
|
||||||
|
#define GLYPH_LEGACY_FIRST 0x1FB00
|
||||||
|
#define GLYPH_LEGACY_LAST 0x1FB9B
|
||||||
|
#define GLYPH_LEGACY_COUNT \
|
||||||
|
(GLYPH_LEGACY_LAST - GLYPH_LEGACY_FIRST + 1)
|
||||||
} custom_glyphs;
|
} custom_glyphs;
|
||||||
|
|
||||||
bool is_sending_paste_data;
|
bool is_sending_paste_data;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue