basic/glyph-util: introduce optional_glyph() to wrap emoji_enabled()

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2025-03-15 14:40:52 +01:00
parent 1ae9b0cfa8
commit 75d51d77da
3 changed files with 11 additions and 2 deletions
+4
View File
@@ -35,6 +35,7 @@ const char* glyph_full(Glyph code, bool force_utf) {
static const char* const draw_table[2][_GLYPH_MAX] = {
/* ASCII fallback */
[false] = {
[GLYPH_SPACE] = " ",
[GLYPH_TREE_VERTICAL] = "| ",
[GLYPH_TREE_BRANCH] = "|-",
[GLYPH_TREE_RIGHT] = "`-",
@@ -87,6 +88,9 @@ const char* glyph_full(Glyph code, bool force_utf) {
/* UTF-8 */
[true] = {
/* This exists to allow more consistent handling of optional whitespace */
[GLYPH_SPACE] = " ",
/* The following are multiple glyphs in both ASCII and in UNICODE */
[GLYPH_TREE_VERTICAL] = u8"│ ",
[GLYPH_TREE_BRANCH] = u8"├─",