Commit 5d1a82c8 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

table: use UTF-8 box drawing characters

parent 1dabbc6f
......@@ -57,9 +57,8 @@ extern "C" {
#define CLR_WHT(str) CLR(37, str) /**< Print str in white */
#define CLR_BLD(str) CLR( 1, str) /**< Print str in bold */
/* Alternate character set
*
* The suffixed of the BOX_ macro a constructed by
/* The suffixed of the BOX_ macro a constructed by
* combining the following letters in the written order:
* - U for a line facing upwards
* - D for a line facing downwards
......@@ -69,16 +68,38 @@ extern "C" {
* E.g. a cross can be constructed by combining all line fragments:
* BOX_UDLR
*/
#define BOX(chr) "\e(0" chr "\e(B"
#define BOX_LR BOX("\x71") /**< Boxdrawing: ─ */
#define BOX_UD BOX("\x78") /**< Boxdrawing: │ */
#define BOX_UDR BOX("\x74") /**< Boxdrawing: ├ */
#define BOX_UDLR BOX("\x6E") /**< Boxdrawing: ┼ */
#define BOX_UDL BOX("\x75") /**< Boxdrawing: ┤ */
#define BOX_ULR BOX("\x76") /**< Boxdrawing: ┴ */
#define BOX_UL BOX("\x6A") /**< Boxdrawing: ┘ */
#define BOX_DLR BOX("\x77") /**< Boxdrawing: ┘ */
#define BOX_DL BOX("\x6B") /**< Boxdrawing: ┘ */
#if 0 /* Alternate character set */
#define BOX(chr) "\e(0" chr "\e(B"
#define BOX_LR BOX("\x71") /**< Boxdrawing: ─ */
#define BOX_UD BOX("\x78") /**< Boxdrawing: │ */
#define BOX_UDR BOX("\x74") /**< Boxdrawing: ├ */
#define BOX_UDLR BOX("\x6E") /**< Boxdrawing: ┼ */
#define BOX_UDL BOX("\x75") /**< Boxdrawing: ┤ */
#define BOX_ULR BOX("\x76") /**< Boxdrawing: ┴ */
#define BOX_UL BOX("\x6A") /**< Boxdrawing: ┘ */
#define BOX_DLR BOX("\x77") /**< Boxdrawing: ┘ */
#define BOX_DL BOX("\x6B") /**< Boxdrawing: ┘ */
#elif 1 /* UTF-8 */
#define BOX_LR "─" /**< Boxdrawing: ─ */
#define BOX_UD "│" /**< Boxdrawing: │ */
#define BOX_UDR "├" /**< Boxdrawing: ├ */
#define BOX_UDLR "┼" /**< Boxdrawing: ┼ */
#define BOX_UDL "┤" /**< Boxdrawing: ┤ */
#define BOX_ULR "┴" /**< Boxdrawing: ┴ */
#define BOX_UL "┘" /**< Boxdrawing: ┘ */
#define BOX_DLR "┬" /**< Boxdrawing: ┘ */
#define BOX_DL "┐" /**< Boxdrawing: ┘ */
#else /* ASCII */
#define BOX_LR "-" /**< Boxdrawing: ─ */
#define BOX_UD "|" /**< Boxdrawing: │ */
#define BOX_UDR "+" /**< Boxdrawing: ├ */
#define BOX_UDLR "+" /**< Boxdrawing: ┼ */
#define BOX_UDL "+" /**< Boxdrawing: ┤ */
#define BOX_ULR "+" /**< Boxdrawing: ┴ */
#define BOX_UL "+" /**< Boxdrawing: ┘ */
#define BOX_DLR "+" /**< Boxdrawing: ┘ */
#define BOX_DL "+" /**< Boxdrawing: ┘ */
#endif
/* CPP stringification */
#define XSTR(x) STR(x)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment