From ef10b8ced27762174a2ed348d87747b11c668cc7 Mon Sep 17 00:00:00 2001 From: nick black Date: Tue, 23 Jun 2020 08:47:28 -0400 Subject: [PATCH] mojibake: order planes by unicode spec --- src/demo/mojibake.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/demo/mojibake.c b/src/demo/mojibake.c index d84285cee..f6a0d36c1 100644 --- a/src/demo/mojibake.c +++ b/src/demo/mojibake.c @@ -26,6 +26,25 @@ mojiplane(struct ncplane* title, int y, int rows, const char* summary){ return n; } +static struct ncplane* +unicode1emoji1(struct ncplane* title, int y){ + const char SUMMARY[] = "[Unicode 1.1 (1993) / Emoji 1.0 (2015), 16 codepoints]"; + const int ROWS = 4; + struct ncplane* n = mojiplane(title, y, ROWS, SUMMARY); + if(n == NULL){ + return NULL; + } + ncplane_putstr_yx(n, 1, 1, "\u2764 (\u2764\ufe0f) \u2709 (\u2709\ufe0f)" + "\u270f (\u270f\ufe0f) \u2712 (\u2712\ufe0f)" + "\u2195 (\u2195\ufe0f) \u2194 (\u2194\ufe0f)" + "\u2716 (\u2716\ufe0f) \u2733 (\u2733\ufe0f)" + "\u2734 (\u2734\ufe0f) \u2747 (\u2747\ufe0f)"); + ncplane_putstr_yx(n, 2, 1, "\u2660 (\u2660\ufe0f) \u2665 (\u2665\ufe0f)" + "\u2666 (\u2666\ufe0f) \u2663 (\u2663\ufe0f)" + "\u260e (\u260e\ufe0f) \u27a1 (\u27a1\ufe0f)"); + return n; +} + static struct ncplane* unicode52(struct ncplane* title, int y){ const char SUMMARY[] = "[Unicode 5.2 (2009), Emoji 1.0 (2015), 24 codepoints]"; @@ -85,27 +104,6 @@ unicode60(struct ncplane* title, int y){ return n; } -static struct ncplane* -unicode1emoji1(struct ncplane* title, int y){ - const char SUMMARY[] = "[Unicode 1.1 (1993) / Emoji 1.0 (2015), 16 codepoints]"; - const int ROWS = 4; - struct ncplane* n = mojiplane(title, y, ROWS, SUMMARY); - if(n == NULL){ - return NULL; - } - ncplane_putstr_yx(n, 1, 1, "\u2764 (\u2764\ufe0f)" - "\u2709 (\u2709\ufe0f)" - "\u270f (\u270f\ufe0f)" - "\u2712 (\u2712\ufe0f)" - "\u2195 (\u2195\ufe0f) \u2194 (\u2194\ufe0f)" - "\u2716 (\u2716\ufe0f) \u2733 (\u2733\ufe0f)" - "\u2734 (\u2734\ufe0f) \u2747 (\u2747\ufe0f)"); - ncplane_putstr_yx(n, 2, 1, "\u2660 (\u2660\ufe0f) \u2665 (\u2665\ufe0f)" - "\u2666 (\u2666\ufe0f) \u2663 (\u2663\ufe0f)" - "\u260e (\u260e\ufe0f) \u27a1 (\u27a1\ufe0f)"); - return n; -} - static struct ncplane* unicode7emoji2(struct ncplane* title, int y){ const char SUMMARY[] = "[Unicode 7.0 (2014) / Emoji 2.0 (2015), 1 codepoint]";