From 1c43fdbea4751de9a84d24be8320712c85045414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 3 Aug 2021 18:10:41 +0200 Subject: [PATCH 1/3] box-drawing: add U+1FB3C-U+1FB6F, U+1FB9A and U+1FB9B MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are the “wedges” from the Unicode 13 “Legacy Computing” symbols. Closes #474 --- CHANGELOG.md | 3 + box-drawing.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++- render.c | 11 +-- terminal.h | 8 +- 4 files changed, 228 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 086b1483..31343451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,9 @@ * `-Ddocs=disabled|enabled|auto` meson command line option. * Support for `~`-expansion in the `include` directive (https://codeberg.org/dnkl/foot/issues/659). +* Unicode 13 characters U+1FB3C - U+1FB6F, U+1FB9A and U+1FB9B to list + of box drawing characters rendered by foot itself (rather than using + font glyphs) (https://codeberg.org/dnkl/foot/issues/474). ### Changed diff --git a/box-drawing.c b/box-drawing.c index b06fc322..817beacd 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -21,6 +21,7 @@ enum thickness { struct buf { uint8_t *data; pixman_image_t *pix; + pixman_format_code_t format; int width; int height; int stride; @@ -52,6 +53,7 @@ change_buffer_format(struct buf *buf, pixman_format_code_t new_format) buf->data = new_data; buf->pix = new_pix; + buf->format = new_format; buf->stride = stride; } @@ -1257,7 +1259,7 @@ set_a1_bit(uint8_t *data, size_t ofs, size_t bit_no) static void draw_box_drawings_light_arc(struct buf *buf, wchar_t wc) { - const pixman_format_code_t fmt = pixman_image_get_format(buf->pix); + const pixman_format_code_t fmt = buf->format; const int supersample = fmt == PIXMAN_a8 ? 4 : 1; const int height = buf->height * supersample; const int width = buf->width * supersample; @@ -1763,7 +1765,7 @@ draw_pixman_shade(struct buf *buf, uint16_t v) static void draw_light_shade(struct buf *buf) { - pixman_format_code_t fmt = pixman_image_get_format(buf->pix); + pixman_format_code_t fmt = buf->format; if (buf->solid_shades && fmt == PIXMAN_a1) change_buffer_format(buf, PIXMAN_a8); @@ -1786,7 +1788,7 @@ draw_light_shade(struct buf *buf) static void draw_medium_shade(struct buf *buf) { - pixman_format_code_t fmt = pixman_image_get_format(buf->pix); + pixman_format_code_t fmt = buf->format; if (buf->solid_shades && fmt == PIXMAN_a1) change_buffer_format(buf, PIXMAN_a8); @@ -1809,7 +1811,7 @@ draw_medium_shade(struct buf *buf) static void draw_dark_shade(struct buf *buf) { - pixman_format_code_t fmt = pixman_image_get_format(buf->pix); + pixman_format_code_t fmt = buf->format; if (buf->solid_shades && fmt == PIXMAN_a1) change_buffer_format(buf, PIXMAN_a8); @@ -2133,6 +2135,183 @@ draw_sextant(struct buf *buf, wchar_t wc) sextant_lower_right(buf); } +static void NOINLINE +draw_wedge_triangle(struct buf *buf, wchar_t wc) +{ + const int width = buf->width; + const int height = buf->height; + const double width_f = width; + const double height_f = height; + + int p1_x, p1_y, p2_x, p2_y, p3_x, p3_y; + + IGNORE_WARNING("-Wpedantic"); + + switch (wc) { + /* Lower left */ + case 0x1fb3c ... 0x1fb40: { + size_t idx = wc - 0x1fb3c; + p1_x = 0; p1_y = (idx < 2 ? 2 * height / 3 : + idx < 4 ? height / 3 : + 0); + p2_x = 0; p2_y = height; + p3_x = idx % 2 ? width : round(width_f / 2.); p3_y = height; + break; + } + + /* Lower right */ + case 0x1fb47 ... 0x1fb4b: { + size_t idx = wc - 0x1fb47; + p1_x = width; p1_y = (idx < 2 ? 2 * height / 3 : + idx < 4 ? height / 3 : + 0); + p2_x = width; p2_y = height; + p3_x = idx % 2 ? 0 : width / 2; p3_y = height; + break; + } + + /* Upper left */ + case 0x1fb57 ... 0x1fb5b: { + size_t idx = wc - 0x1fb57; + p1_x = 0; p1_y = 0; + p2_x = 0; p2_y = (idx < 2 ? round(height_f / 3.) : + idx < 4 ? round(2. * height_f / 3.) : + height); + p3_x = idx % 2 ? width : round(width_f / 2.); p3_y = 0; + break; + } + + /* Upper right */ + case 0x1fb62 ... 0x1fb66: { + size_t idx = wc - 0x1fb62; + p1_x = width; p1_y = 0; + p2_x = width; p2_y = (idx < 2 ? round(height_f / 3.) : + idx < 4 ? round(2. * height_f / 3.) : + height); + p3_x = idx % 2 ? 0 : width / 2; p3_y = 0; + break; + } + + case 0x1fb46: + p1_x = 0; p1_y = round(2. * height_f / 3.); + p2_x = width; p2_y = height / 3; + p3_x = width; p3_y = p1_y; + break; + + case 0x1fb51: + p1_x = 0; p1_y = height / 3; + p2_x = 0; p2_y = round(2. * height_f / 3.); + p3_x = width; p3_y = p2_y; + break; + + case 0x1fb5c: + p1_x = 0; p1_y = height / 3; + p2_x = 0; p2_y = round(2. * height_f / 3.); + p3_x = width; p3_y = p1_y; + break; + + case 0x1fb67: + p1_x = 0; p1_y = height / 3; + p2_x = width; p2_y = p1_y; + p3_x = width; p3_y = round(2. * height_f / 3.); + break; + + case 0x1fb6c: + p1_x = 0; p1_y = 0; + p2_x = round(width_f / 2.); p2_y = round(height_f / 2.); + p3_x = 0; p3_y = height; + break; + + case 0x1fb6d: + p1_x = 0; p1_y = 0; + p2_x = width / 2; p2_y = round(height_f / 2.); + p3_x = width; p3_y = 0; + break; + + case 0x1fb6e: + p1_x = width; p1_y = 0; + p2_x = width / 2; p2_y = round(height_f / 2.); + p3_x = width; p3_y = height; + break; + + case 0x1fb6f: + p1_x = 0; p1_y = height; + p2_x = width / 2; p2_y = round(height_f / 2.); + p3_x = width; p3_y = height; + break; + + default: + BUG("unimplemented Unicode codepoint"); + break; + } + + UNIGNORE_WARNINGS; + + const pixman_triangle_t tri = { + .p1 = {.x = pixman_int_to_fixed(p1_x), .y = pixman_int_to_fixed(p1_y)}, + .p2 = {.x = pixman_int_to_fixed(p2_x), .y = pixman_int_to_fixed(p2_y)}, + .p3 = {.x = pixman_int_to_fixed(p3_x), .y = pixman_int_to_fixed(p3_y)}, + }; + + pixman_image_t *src = pixman_image_create_solid_fill(&white); + pixman_composite_triangles( + PIXMAN_OP_OVER, src, buf->pix, buf->format, 0, 0, 0, 0, 1, &tri); + pixman_image_unref(src); +} + +static void +draw_wedge_triangle_inverted(struct buf *buf, wchar_t wc) +{ + IGNORE_WARNING("-Wpedantic"); + + switch (wc) { + case 0x1fb41 ... 0x1fb45: wc = wc - 0x1fb41 + 0x1fb57; break; + case 0x1fb4c ... 0x1fb50: wc = wc - 0x1fb4c + 0x1fb62; break; + case 0x1fb52 ... 0x1fb56: wc = wc - 0x1fb52 + 0x1fb3c; break; + case 0x1fb5d ... 0x1fb61: wc = wc - 0x1fb5d + 0x1fb47; break; + case 0x1fb68 ... 0x1fb6b: wc = wc - 0x1fb68 + 0x1fb6c; break; + } + + UNIGNORE_WARNINGS; + + draw_wedge_triangle(buf, wc); + + pixman_image_t *src = pixman_image_create_solid_fill(&white); + pixman_image_composite(PIXMAN_OP_OUT, src, NULL, buf->pix, 0, 0, 0, 0, 0, 0, buf->width, buf->height); + pixman_image_unref(src); +} + +static void +draw_wedge_triangle_and_box(struct buf *buf, wchar_t wc) +{ + draw_wedge_triangle(buf, wc); + + const int width = buf->width; + const int height = buf->height; + + pixman_box32_t box; + + switch (wc) { + case 0x1fb46: + case 0x1fb51: + box = (pixman_box32_t){ + .x1 = 0, .y1 = round(2. * height / 3.), + .x2 = width, .y2 = height, + }; + break; + + case 0x1fb5c: + case 0x1fb67: + box = (pixman_box32_t){ + .x1 = 0, .y1 = 0, + .x2 = width, .y2 = height / 3, + }; + break; + } + + pixman_image_fill_boxes(PIXMAN_OP_SRC, buf->pix, &white, 1, &box); +} + static void draw_left_and_lower_one_eighth_block(struct buf *buf) { @@ -2382,6 +2561,39 @@ draw_glyph(struct buf *buf, wchar_t wc) case 0x1fb00 ... 0x1fb3b: draw_sextant(buf, wc); break; + case 0x1fb3c ... 0x1fb40: + case 0x1fb47 ... 0x1fb4b: + case 0x1fb57 ... 0x1fb5b: + case 0x1fb62 ... 0x1fb66: + case 0x1fb6c ... 0x1fb6f: + draw_wedge_triangle(buf, wc); + break; + + case 0x1fb41 ... 0x1fb45: + case 0x1fb4c ... 0x1fb50: + case 0x1fb52 ... 0x1fb56: + case 0x1fb5d ... 0x1fb61: + case 0x1fb68 ... 0x1fb6b: + draw_wedge_triangle_inverted(buf, wc); + break; + + case 0x1fb46: + case 0x1fb51: + case 0x1fb5c: + case 0x1fb67: + draw_wedge_triangle_and_box(buf, wc); + break; + + case 0x1fb9a: + draw_wedge_triangle(buf, 0x1fb6d); + draw_wedge_triangle(buf, 0x1fb6f); + break; + + case 0x1fb9b: + draw_wedge_triangle(buf, 0x1fb6c); + draw_wedge_triangle(buf, 0x1fb6e); + break; + case 0x1fb70: draw_vertical_one_eighth_block_2(buf); break; case 0x1fb71: draw_vertical_one_eighth_block_3(buf); break; case 0x1fb72: draw_vertical_one_eighth_block_4(buf); break; @@ -2443,6 +2655,7 @@ box_drawing(const struct terminal *term, wchar_t wc) struct buf buf = { .data = data, .pix = pix, + .format = fmt, .width = width, .height = height, .stride = stride, diff --git a/render.c b/render.c index d338301c..b8a013f1 100644 --- a/render.c +++ b/render.c @@ -538,18 +538,15 @@ render_cell(struct terminal *term, pixman_image_t *pix, */ /* Unicode 13 sextants */ - (base >= 0x1fb00 && base <= 0x1fb3b) || - - /* Unicode 13 partial blocks */ - /* TODO: there's more here! */ - (base >= 0x1fb70 && base <= 0x1fb8b)) && + (base >= 0x1fb00 && base <= 0x1fb8b) || + (base >= 0x1fb9a && base <= 0x1fb9b)) && likely(!term->conf->box_drawings_uses_font_glyphs)) { /* Box drawing characters */ size_t idx = base >= 0x1fb00 - ? (base >= 0x1fb70 - ? base - 0x1fb70 + 220 + ? (base >= 0x1fb9a + ? base - 0x1fb9a + 300 : base - 0x1fb00 + 160) : base - 0x2500; xassert(idx < ALEN(term->box_drawing)); diff --git a/terminal.h b/terminal.h index 6e8aa264..74a8f2de 100644 --- a/terminal.h +++ b/terminal.h @@ -334,11 +334,11 @@ struct terminal { enum fcft_subpixel font_subpixel; /* - * 0-159: U+250U+259F - * 160-219: U+1FB00-1FB3B - * 220-247: U+1FB70-1FB8B + * 0-159: U+02500+0259F + * 160-299: U+1FB00-1FB8B + * 300-301: U+1FB9A-1FB9B */ - struct fcft_glyph *box_drawing[248]; + struct fcft_glyph *box_drawing[302]; bool is_sending_paste_data; ptmx_buffer_list_t ptmx_buffers; From 56d7a51d35fbb1f8c188dc1adf8730b3eb83f531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 4 Aug 2021 17:32:35 +0200 Subject: [PATCH 2/3] =?UTF-8?q?box-drawing:=20wedges:=20don=E2=80=99t=20gr?= =?UTF-8?q?oup=20similar=20cases=20together?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since they’re not exactly alike, we still need branches within each case. Better to split them up - one case per codepoint. --- box-drawing.c | 148 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 100 insertions(+), 48 deletions(-) diff --git a/box-drawing.c b/box-drawing.c index 817beacd..686d5b77 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -2145,96 +2145,150 @@ draw_wedge_triangle(struct buf *buf, wchar_t wc) int p1_x, p1_y, p2_x, p2_y, p3_x, p3_y; - IGNORE_WARNING("-Wpedantic"); - switch (wc) { - /* Lower left */ - case 0x1fb3c ... 0x1fb40: { - size_t idx = wc - 0x1fb3c; - p1_x = 0; p1_y = (idx < 2 ? 2 * height / 3 : - idx < 4 ? height / 3 : - 0); - p2_x = 0; p2_y = height; - p3_x = idx % 2 ? width : round(width_f / 2.); p3_y = height; + case 0x1fb3c: /* 🬼 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = 2 * height / 3; p2_y = p3_y = height; break; - } - /* Lower right */ - case 0x1fb47 ... 0x1fb4b: { - size_t idx = wc - 0x1fb47; - p1_x = width; p1_y = (idx < 2 ? 2 * height / 3 : - idx < 4 ? height / 3 : - 0); - p2_x = width; p2_y = height; - p3_x = idx % 2 ? 0 : width / 2; p3_y = height; + case 0x1fb3d: /* 🬽 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = 2 * height / 3; p2_y = p3_y = height; break; - } - /* Upper left */ - case 0x1fb57 ... 0x1fb5b: { - size_t idx = wc - 0x1fb57; - p1_x = 0; p1_y = 0; - p2_x = 0; p2_y = (idx < 2 ? round(height_f / 3.) : - idx < 4 ? round(2. * height_f / 3.) : - height); - p3_x = idx % 2 ? width : round(width_f / 2.); p3_y = 0; + case 0x1fb3e: /* 🬾 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = height / 3; p2_y = p3_y = height; break; - } - /* Upper right */ - case 0x1fb62 ... 0x1fb66: { - size_t idx = wc - 0x1fb62; - p1_x = width; p1_y = 0; - p2_x = width; p2_y = (idx < 2 ? round(height_f / 3.) : - idx < 4 ? round(2. * height_f / 3.) : - height); - p3_x = idx % 2 ? 0 : width / 2; p3_y = 0; + case 0x1fb3f: /* 🬿 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = height / 3; p2_y = p3_y = height; break; - } - case 0x1fb46: + case 0x1fb40: /* 🭀 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = 0; p2_y = p3_y = height; + break; + + case 0x1fb47: /* 🭇 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = 2 * height / 3; p2_y = p3_y = height; + break; + + case 0x1fb48: /* 🭈 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = 2 * height / 3; p2_y = p3_y = height; + break; + + case 0x1fb49: /* 🭉 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = height / 3; p2_y = p3_y = height; + break; + + case 0x1fb4a: /* 🭊 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = height / 3; p2_y = p3_y = height; + break; + + case 0x1fb4b: /* 🭋 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = 0; p2_y = p3_y = height; + break; + + case 0x1fb57: /* 🭗 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = p3_y = 0; p2_y = round(height_f / 3.); + break; + + case 0x1fb58: /* 🭘 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = p3_y = 0; p2_y = round(height_f / 3.); + break; + + case 0x1fb59: /* 🭙 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); + break; + + case 0x1fb5a: /* 🭚 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); + break; + + case 0x1fb5b: /* 🭛 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = p3_y = 0; p2_y = height; + break; + + case 0x1fb62: /* 🭢 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = p3_y = 0; p2_y = round(height_f / 3.); + break; + + case 0x1fb63: /* 🭣 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = p3_y = 0; p2_y = round(height_f / 3.); + break; + + case 0x1fb64: /* 🭤 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); + break; + + case 0x1fb65: /* 🭥 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); + break; + + case 0x1fb66: /* 🭦 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = p3_y = 0; p2_y = height; + break; + + case 0x1fb46: /* 🭆 */ p1_x = 0; p1_y = round(2. * height_f / 3.); p2_x = width; p2_y = height / 3; p3_x = width; p3_y = p1_y; break; - case 0x1fb51: + case 0x1fb51: /* 🭑 */ p1_x = 0; p1_y = height / 3; p2_x = 0; p2_y = round(2. * height_f / 3.); p3_x = width; p3_y = p2_y; break; - case 0x1fb5c: + case 0x1fb5c: /* 🭜 */ p1_x = 0; p1_y = height / 3; p2_x = 0; p2_y = round(2. * height_f / 3.); p3_x = width; p3_y = p1_y; break; - case 0x1fb67: + case 0x1fb67: /* 🭧 */ p1_x = 0; p1_y = height / 3; p2_x = width; p2_y = p1_y; p3_x = width; p3_y = round(2. * height_f / 3.); break; - case 0x1fb6c: + case 0x1fb6c: /* 🭬 */ p1_x = 0; p1_y = 0; p2_x = round(width_f / 2.); p2_y = round(height_f / 2.); p3_x = 0; p3_y = height; break; - case 0x1fb6d: + case 0x1fb6d: /* 🭭 */ p1_x = 0; p1_y = 0; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = 0; break; - case 0x1fb6e: + case 0x1fb6e: /* 🭮 */ p1_x = width; p1_y = 0; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = height; break; - case 0x1fb6f: + case 0x1fb6f: /* 🭯 */ p1_x = 0; p1_y = height; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = height; @@ -2245,8 +2299,6 @@ draw_wedge_triangle(struct buf *buf, wchar_t wc) break; } - UNIGNORE_WARNINGS; - const pixman_triangle_t tri = { .p1 = {.x = pixman_int_to_fixed(p1_x), .y = pixman_int_to_fixed(p1_y)}, .p2 = {.x = pixman_int_to_fixed(p2_x), .y = pixman_int_to_fixed(p2_y)}, From 36ecd0baede55c46d910b03273dff93a5db181ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 5 Aug 2021 18:21:06 +0200 Subject: [PATCH 3/3] box-drawing: wedges: fix alignment of inverted wedges MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We render the inverted wedges by first rendering a non-inverted triangle, and then inverting it with PIXMAN_OP_OUT. In cases where truncating and round():ing the triangle points have different results, the final, inverted wedge ends up being unaligned with the corresponding sixel(s). This patch fixes that by handling the pre-inverted triangles specifically. I.e. we don’t re-use the same triangle coordinates as the corresponding non-inverted triangle. --- box-drawing.c | 142 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 109 insertions(+), 33 deletions(-) diff --git a/box-drawing.c b/box-drawing.c index 686d5b77..85a2d4be 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -2151,144 +2151,232 @@ draw_wedge_triangle(struct buf *buf, wchar_t wc) p1_y = 2 * height / 3; p2_y = p3_y = height; break; + case 0x1fb52: /* 🭒 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = round(2. * height_f / 3.); p2_y = p3_y = height; + break; + case 0x1fb3d: /* 🬽 */ p1_x = p2_x = 0; p3_x = width; p1_y = 2 * height / 3; p2_y = p3_y = height; break; + case 0x1fb53: /* 🭓 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = round(2. * height_f / 3.); p2_y = p3_y = height; + break; + case 0x1fb3e: /* 🬾 */ p1_x = p2_x = 0; p3_x = round(width_f / 2.); p1_y = height / 3; p2_y = p3_y = height; break; + case 0x1fb54: /* 🭔 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = round(height_f / 3.); p2_y = p3_y = height; + break; + case 0x1fb3f: /* 🬿 */ p1_x = p2_x = 0; p3_x = width; p1_y = height / 3; p2_y = p3_y = height; break; + case 0x1fb55: /* 🭕 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = round(height_f / 3.); p2_y = p3_y = height; + break; + case 0x1fb40: /* 🭀 */ + case 0x1fb56: /* 🭖 */ p1_x = p2_x = 0; p3_x = round(width_f / 2.); p1_y = 0; p2_y = p3_y = height; break; - case 0x1fb47: /* 🭇 */ + case 0x1fb47: /* 🭇 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = 2 * height / 3; p2_y = p3_y = height; break; - case 0x1fb48: /* 🭈 */ + case 0x1fb5d: /* 🭝 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = round(2. * height_f / 3.); p2_y = p3_y = height; + break; + + case 0x1fb48: /* 🭈 */ p1_x = p2_x = width; p3_x = 0; p1_y = 2 * height / 3; p2_y = p3_y = height; break; - case 0x1fb49: /* 🭉 */ + case 0x1fb5e: /* 🭞 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = round(2. * height_f / 3.); p2_y = p3_y = height; + break; + + case 0x1fb49: /* 🭉 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = height / 3; p2_y = p3_y = height; break; - case 0x1fb4a: /* 🭊 */ + case 0x1fb5f: /* 🭟 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = round(height_f / 3.); p2_y = p3_y = height; + break; + + case 0x1fb4a: /* 🭊 */ p1_x = p2_x = width; p3_x = 0; p1_y = height / 3; p2_y = p3_y = height; break; - case 0x1fb4b: /* 🭋 */ + case 0x1fb60: /* 🭠 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = round(height_f / 3.); p2_y = p3_y = height; + break; + + case 0x1fb4b: /* 🭋 */ + case 0x1fb61: /* 🭡 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = 0; p2_y = p3_y = height; break; - case 0x1fb57: /* 🭗 */ + case 0x1fb57: /* 🭗 */ p1_x = p2_x = 0; p3_x = round(width_f / 2.); p1_y = p3_y = 0; p2_y = round(height_f / 3.); break; - case 0x1fb58: /* 🭘 */ + case 0x1fb41: /* 🭁 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = p3_y = 0; p2_y = height / 3; + break; + + case 0x1fb58: /* 🭘 */ p1_x = p2_x = 0; p3_x = width; p1_y = p3_y = 0; p2_y = round(height_f / 3.); break; - case 0x1fb59: /* 🭙 */ + case 0x1fb42: /* 🭂 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = p3_y = 0; p2_y = height / 3; + break; + + case 0x1fb59: /* 🭙 */ p1_x = p2_x = 0; p3_x = round(width_f / 2.); p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); break; - case 0x1fb5a: /* 🭚 */ + case 0x1fb43: /* 🭃 */ + p1_x = p2_x = 0; p3_x = round(width_f / 2.); + p1_y = p3_y = 0; p2_y = 2 * height / 3; + break; + + case 0x1fb5a: /* 🭚 */ p1_x = p2_x = 0; p3_x = width; p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); break; - case 0x1fb5b: /* 🭛 */ + case 0x1fb44: /* 🭄 */ + p1_x = p2_x = 0; p3_x = width; + p1_y = p3_y = 0; p2_y = 2 * height / 3; + break; + + case 0x1fb5b: /* 🭛 */ + case 0x1fb45: /* 🭅 */ p1_x = p2_x = 0; p3_x = round(width_f / 2.); p1_y = p3_y = 0; p2_y = height; break; - case 0x1fb62: /* 🭢 */ + case 0x1fb62: /* 🭢 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = p3_y = 0; p2_y = round(height_f / 3.); break; + case 0x1fb4c: /* 🭌 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = p3_y = 0; p2_y = height / 3; + break; + case 0x1fb63: /* 🭣 */ p1_x = p2_x = width; p3_x = 0; p1_y = p3_y = 0; p2_y = round(height_f / 3.); break; - case 0x1fb64: /* 🭤 */ + case 0x1fb4d: /* 🭍 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = p3_y = 0; p2_y = height / 3; + break; + + case 0x1fb64: /* 🭤 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); break; - case 0x1fb65: /* 🭥 */ + case 0x1fb4e: /* 🭎 */ + p1_x = p2_x = width; p3_x = width / 2; + p1_y = p3_y = 0; p2_y = 2 * height / 3; + break; + + case 0x1fb65: /* 🭥 */ p1_x = p2_x = width; p3_x = 0; p1_y = p3_y = 0; p2_y = round(2. * height_f / 3.); break; + case 0x1fb4f: /* 🭏 */ + p1_x = p2_x = width; p3_x = 0; + p1_y = p3_y = 0; p2_y = 2 * height / 3; + break; + case 0x1fb66: /* 🭦 */ + case 0x1fb50: /* 🭐 */ p1_x = p2_x = width; p3_x = width / 2; p1_y = p3_y = 0; p2_y = height; break; - case 0x1fb46: /* 🭆 */ + case 0x1fb46: /* 🭆 */ p1_x = 0; p1_y = round(2. * height_f / 3.); p2_x = width; p2_y = height / 3; p3_x = width; p3_y = p1_y; break; - case 0x1fb51: /* 🭑 */ + case 0x1fb51: /* 🭑 */ p1_x = 0; p1_y = height / 3; p2_x = 0; p2_y = round(2. * height_f / 3.); p3_x = width; p3_y = p2_y; break; - case 0x1fb5c: /* 🭜 */ + case 0x1fb5c: /* 🭜 */ p1_x = 0; p1_y = height / 3; p2_x = 0; p2_y = round(2. * height_f / 3.); p3_x = width; p3_y = p1_y; break; - case 0x1fb67: /* 🭧 */ + case 0x1fb67: /* 🭧 */ p1_x = 0; p1_y = height / 3; p2_x = width; p2_y = p1_y; p3_x = width; p3_y = round(2. * height_f / 3.); break; - case 0x1fb6c: /* 🭬 */ + case 0x1fb6c: /* 🭬 */ + case 0x1fb68: /* 🭨 */ p1_x = 0; p1_y = 0; p2_x = round(width_f / 2.); p2_y = round(height_f / 2.); p3_x = 0; p3_y = height; break; - case 0x1fb6d: /* 🭭 */ + case 0x1fb6d: /* 🭭 */ + case 0x1fb69: /* 🭩 */ p1_x = 0; p1_y = 0; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = 0; break; - case 0x1fb6e: /* 🭮 */ + case 0x1fb6e: /* 🭮 */ + case 0x1fb6a: /* 🭪 */ p1_x = width; p1_y = 0; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = height; break; - case 0x1fb6f: /* 🭯 */ + case 0x1fb6f: /* 🭯 */ + case 0x1fb6b: /* 🭫 */ p1_x = 0; p1_y = height; p2_x = width / 2; p2_y = round(height_f / 2.); p3_x = width; p3_y = height; @@ -2314,18 +2402,6 @@ draw_wedge_triangle(struct buf *buf, wchar_t wc) static void draw_wedge_triangle_inverted(struct buf *buf, wchar_t wc) { - IGNORE_WARNING("-Wpedantic"); - - switch (wc) { - case 0x1fb41 ... 0x1fb45: wc = wc - 0x1fb41 + 0x1fb57; break; - case 0x1fb4c ... 0x1fb50: wc = wc - 0x1fb4c + 0x1fb62; break; - case 0x1fb52 ... 0x1fb56: wc = wc - 0x1fb52 + 0x1fb3c; break; - case 0x1fb5d ... 0x1fb61: wc = wc - 0x1fb5d + 0x1fb47; break; - case 0x1fb68 ... 0x1fb6b: wc = wc - 0x1fb68 + 0x1fb6c; break; - } - - UNIGNORE_WARNINGS; - draw_wedge_triangle(buf, wc); pixman_image_t *src = pixman_image_create_solid_fill(&white);