diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-01-07 10:51:50 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-01-07 13:21:22 +0100 |
commit | 67861acdf3f02f2bb3529c1d34fe161d07d1bea9 (patch) | |
tree | c5bfd93c58d1be30a51f4385e927ec8018bbd167 /src/basic | |
parent | Merge pull request #14420 from DaanDeMeyer/nspawn-fix-read-only-overlay-rootfs (diff) | |
download | systemd-67861acdf3f02f2bb3529c1d34fe161d07d1bea9.tar.xz systemd-67861acdf3f02f2bb3529c1d34fe161d07d1bea9.zip |
locale-util: extend comments on unicode glyph use, and drop mdash (that actually was an ndash)
Let's add the actual unicode names of the glyphs we use. Let's also add
in comments what the width expectations of these glyphs are on the
console.
Also, remove the "mdash" definition. First of all it wasn't used, but
what's worse the glyph encoded was actually an "ndash"...
Fixes: #14075
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/locale-util.c | 37 | ||||
-rw-r--r-- | src/basic/locale-util.h | 5 |
2 files changed, 24 insertions, 18 deletions
diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index 457280df9f..dc62511935 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -342,12 +342,11 @@ const char *special_glyph(SpecialGlyph code) { [SPECIAL_GLYPH_TRIANGULAR_BULLET] = ">", [SPECIAL_GLYPH_BLACK_CIRCLE] = "*", [SPECIAL_GLYPH_BULLET] = "*", - [SPECIAL_GLYPH_ARROW] = "->", - [SPECIAL_GLYPH_MDASH] = "-", - [SPECIAL_GLYPH_ELLIPSIS] = "...", [SPECIAL_GLYPH_MU] = "u", [SPECIAL_GLYPH_CHECK_MARK] = "+", [SPECIAL_GLYPH_CROSS_MARK] = "-", + [SPECIAL_GLYPH_ARROW] = "->", + [SPECIAL_GLYPH_ELLIPSIS] = "...", [SPECIAL_GLYPH_ECSTATIC_SMILEY] = ":-]", [SPECIAL_GLYPH_HAPPY_SMILEY] = ":-}", [SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = ":-)", @@ -359,26 +358,34 @@ const char *special_glyph(SpecialGlyph code) { /* UTF-8 */ [true] = { + /* The following are multiple glyphs in both ASCII and in UNICODE */ [SPECIAL_GLYPH_TREE_VERTICAL] = "\342\224\202 ", /* │ */ [SPECIAL_GLYPH_TREE_BRANCH] = "\342\224\234\342\224\200", /* ├─ */ [SPECIAL_GLYPH_TREE_RIGHT] = "\342\224\224\342\224\200", /* └─ */ [SPECIAL_GLYPH_TREE_SPACE] = " ", /* */ + + /* Single glyphs in both cases */ [SPECIAL_GLYPH_TRIANGULAR_BULLET] = "\342\200\243", /* ‣ */ [SPECIAL_GLYPH_BLACK_CIRCLE] = "\342\227\217", /* ● */ [SPECIAL_GLYPH_BULLET] = "\342\200\242", /* • */ - [SPECIAL_GLYPH_ARROW] = "\342\206\222", /* → */ - [SPECIAL_GLYPH_MDASH] = "\342\200\223", /* – */ - [SPECIAL_GLYPH_ELLIPSIS] = "\342\200\246", /* … */ - [SPECIAL_GLYPH_MU] = "\316\274", /* μ */ + [SPECIAL_GLYPH_MU] = "\316\274", /* μ (actually called: GREEK SMALL LETTER MU) */ [SPECIAL_GLYPH_CHECK_MARK] = "\342\234\223", /* ✓ */ - [SPECIAL_GLYPH_CROSS_MARK] = "\342\234\227", /* ✗ */ - [SPECIAL_GLYPH_ECSTATIC_SMILEY] = "\360\237\230\207", /* 😇 */ - [SPECIAL_GLYPH_HAPPY_SMILEY] = "\360\237\230\200", /* 😀 */ - [SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = "\360\237\231\202", /* 🙂 */ - [SPECIAL_GLYPH_NEUTRAL_SMILEY] = "\360\237\230\220", /* 😐 */ - [SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = "\360\237\231\201", /* 🙁 */ - [SPECIAL_GLYPH_UNHAPPY_SMILEY] = "\360\237\230\250", /* 😨 */ - [SPECIAL_GLYPH_DEPRESSED_SMILEY] = "\360\237\244\242", /* 🤢 */ + [SPECIAL_GLYPH_CROSS_MARK] = "\342\234\227", /* ✗ (actually called: BALLOT X) */ + + /* Single glyph in Unicode, two in ASCII */ + [SPECIAL_GLYPH_ARROW] = "\342\206\222", /* → (actually called: RIGHTWARDS ARROW) */ + + /* Single glyph in Unicode, three in ASCII */ + [SPECIAL_GLYPH_ELLIPSIS] = "\342\200\246", /* … (actually called: HORIZONTAL ELLIPSIS) */ + + /* These smileys are a single glyph in Unicode, and three in ASCII */ + [SPECIAL_GLYPH_ECSTATIC_SMILEY] = "\360\237\230\207", /* 😇 (actually called: SMILING FACE WITH HALO) */ + [SPECIAL_GLYPH_HAPPY_SMILEY] = "\360\237\230\200", /* 😀 (actually called: GRINNING FACE) */ + [SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY] = "\360\237\231\202", /* 🙂 (actually called: SLIGHTLY SMILING FACE) */ + [SPECIAL_GLYPH_NEUTRAL_SMILEY] = "\360\237\230\220", /* 😐 (actually called: NEUTRAL FACE) */ + [SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY] = "\360\237\231\201", /* 🙁 (actually called: SLIGHTLY FROWNING FACE) */ + [SPECIAL_GLYPH_UNHAPPY_SMILEY] = "\360\237\230\250", /* 😨 (actually called: FEARFUL FACE) */ + [SPECIAL_GLYPH_DEPRESSED_SMILEY] = "\360\237\244\242", /* 🤢 (actually called: NAUSEATED FACE) */ }, }; diff --git a/src/basic/locale-util.h b/src/basic/locale-util.h index 78abbafd8f..1df8ac4cb0 100644 --- a/src/basic/locale-util.h +++ b/src/basic/locale-util.h @@ -46,12 +46,11 @@ typedef enum { SPECIAL_GLYPH_TRIANGULAR_BULLET, SPECIAL_GLYPH_BLACK_CIRCLE, SPECIAL_GLYPH_BULLET, - SPECIAL_GLYPH_ARROW, - SPECIAL_GLYPH_MDASH, - SPECIAL_GLYPH_ELLIPSIS, SPECIAL_GLYPH_MU, SPECIAL_GLYPH_CHECK_MARK, SPECIAL_GLYPH_CROSS_MARK, + SPECIAL_GLYPH_ARROW, + SPECIAL_GLYPH_ELLIPSIS, _SPECIAL_GLYPH_FIRST_SMILEY, SPECIAL_GLYPH_ECSTATIC_SMILEY = _SPECIAL_GLYPH_FIRST_SMILEY, SPECIAL_GLYPH_HAPPY_SMILEY, |