| 1 | /* |
| 2 | * Jexer - Java Text User Interface |
| 3 | * |
| 4 | * The MIT License (MIT) |
| 5 | * |
| 6 | * Copyright (C) 2019 Kevin Lamonte |
| 7 | * |
| 8 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 9 | * copy of this software and associated documentation files (the "Software"), |
| 10 | * to deal in the Software without restriction, including without limitation |
| 11 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 12 | * and/or sell copies of the Software, and to permit persons to whom the |
| 13 | * Software is furnished to do so, subject to the following conditions: |
| 14 | * |
| 15 | * The above copyright notice and this permission notice shall be included in |
| 16 | * all copies or substantial portions of the Software. |
| 17 | * |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 24 | * DEALINGS IN THE SOFTWARE. |
| 25 | * |
| 26 | * @author Kevin Lamonte [kevin.lamonte@gmail.com] |
| 27 | * @version 1 |
| 28 | */ |
| 29 | package jexer.bits; |
| 30 | |
| 31 | /** |
| 32 | * This class contains a collection of special characters used by the |
| 33 | * windowing system and the mappings from CP437 to Unicode. |
| 34 | */ |
| 35 | public final class GraphicsChars { |
| 36 | |
| 37 | // ------------------------------------------------------------------------ |
| 38 | // Constants -------------------------------------------------------------- |
| 39 | // ------------------------------------------------------------------------ |
| 40 | |
| 41 | /** |
| 42 | * The CP437 to Unicode translation map. |
| 43 | */ |
| 44 | public static final char [] CP437 = { |
| 45 | '\u2007', '\u263A', '\u263B', '\u2665', |
| 46 | '\u2666', '\u2663', '\u2660', '\u2022', |
| 47 | '\u25D8', '\u25CB', '\u25D9', '\u2642', |
| 48 | '\u2640', '\u266A', '\u266B', '\u263C', |
| 49 | // Terminus has 25B6 and 25C0 here, which I believe are better |
| 50 | // Unicode equivalents anyway. |
| 51 | // '\u25BA', '\u25C4', '\u2195', '\u203C', |
| 52 | '\u25B6', '\u25C0', '\u2195', '\u203C', |
| 53 | '\u00B6', '\u00A7', '\u25AC', '\u21A8', |
| 54 | '\u2191', '\u2193', '\u2192', '\u2190', |
| 55 | '\u221F', '\u2194', '\u25B2', '\u25BC', |
| 56 | '\u0020', '\u0021', '\"', '\u0023', |
| 57 | '\u0024', '\u0025', '\u0026', '\'', |
| 58 | '\u0028', '\u0029', '\u002a', '\u002b', |
| 59 | '\u002c', '\u002d', '\u002e', '\u002f', |
| 60 | '\u0030', '\u0031', '\u0032', '\u0033', |
| 61 | '\u0034', '\u0035', '\u0036', '\u0037', |
| 62 | '\u0038', '\u0039', '\u003a', '\u003b', |
| 63 | '\u003c', '\u003d', '\u003e', '\u003f', |
| 64 | '\u0040', '\u0041', '\u0042', '\u0043', |
| 65 | '\u0044', '\u0045', '\u0046', '\u0047', |
| 66 | '\u0048', '\u0049', '\u004a', '\u004b', |
| 67 | '\u004c', '\u004d', '\u004e', '\u004f', |
| 68 | '\u0050', '\u0051', '\u0052', '\u0053', |
| 69 | '\u0054', '\u0055', '\u0056', '\u0057', |
| 70 | '\u0058', '\u0059', '\u005a', '\u005b', |
| 71 | '\\', '\u005d', '\u005e', '\u005f', |
| 72 | '\u0060', '\u0061', '\u0062', '\u0063', |
| 73 | '\u0064', '\u0065', '\u0066', '\u0067', |
| 74 | '\u0068', '\u0069', '\u006a', '\u006b', |
| 75 | '\u006c', '\u006d', '\u006e', '\u006f', |
| 76 | '\u0070', '\u0071', '\u0072', '\u0073', |
| 77 | '\u0074', '\u0075', '\u0076', '\u0077', |
| 78 | '\u0078', '\u0079', '\u007a', '\u007b', |
| 79 | '\u007c', '\u007d', '\u007e', '\u2302', |
| 80 | '\u00c7', '\u00fc', '\u00e9', '\u00e2', |
| 81 | '\u00e4', '\u00e0', '\u00e5', '\u00e7', |
| 82 | '\u00ea', '\u00eb', '\u00e8', '\u00ef', |
| 83 | '\u00ee', '\u00ec', '\u00c4', '\u00c5', |
| 84 | '\u00c9', '\u00e6', '\u00c6', '\u00f4', |
| 85 | '\u00f6', '\u00f2', '\u00fb', '\u00f9', |
| 86 | '\u00ff', '\u00d6', '\u00dc', '\u00a2', |
| 87 | '\u00a3', '\u00a5', '\u20a7', '\u0192', |
| 88 | '\u00e1', '\u00ed', '\u00f3', '\u00fa', |
| 89 | '\u00f1', '\u00d1', '\u00aa', '\u00ba', |
| 90 | '\u00bf', '\u2310', '\u00ac', '\u00bd', |
| 91 | '\u00bc', '\u00a1', '\u00ab', '\u00bb', |
| 92 | '\u2591', '\u2592', '\u2593', '\u2502', |
| 93 | '\u2524', '\u2561', '\u2562', '\u2556', |
| 94 | '\u2555', '\u2563', '\u2551', '\u2557', |
| 95 | '\u255d', '\u255c', '\u255b', '\u2510', |
| 96 | '\u2514', '\u2534', '\u252c', '\u251c', |
| 97 | '\u2500', '\u253c', '\u255e', '\u255f', |
| 98 | '\u255a', '\u2554', '\u2569', '\u2566', |
| 99 | '\u2560', '\u2550', '\u256c', '\u2567', |
| 100 | '\u2568', '\u2564', '\u2565', '\u2559', |
| 101 | '\u2558', '\u2552', '\u2553', '\u256b', |
| 102 | '\u256a', '\u2518', '\u250c', '\u2588', |
| 103 | '\u2584', '\u258c', '\u2590', '\u2580', |
| 104 | '\u03b1', '\u00df', '\u0393', '\u03c0', |
| 105 | '\u03a3', '\u03c3', '\u00b5', '\u03c4', |
| 106 | '\u03a6', '\u0398', '\u03a9', '\u03b4', |
| 107 | '\u221e', '\u03c6', '\u03b5', '\u2229', |
| 108 | '\u2261', '\u00b1', '\u2265', '\u2264', |
| 109 | '\u2320', '\u2321', '\u00f7', '\u2248', |
| 110 | '\u00b0', '\u2219', '\u00b7', '\u221a', |
| 111 | '\u207f', '\u00b2', '\u25a0', '\u00a0' |
| 112 | }; |
| 113 | |
| 114 | public static final char HATCH = CP437[0xB0]; |
| 115 | public static final char DOUBLE_BAR = CP437[0xCD]; |
| 116 | public static final char BOX = CP437[0xFE]; |
| 117 | public static final char CHECK = CP437[0xFB]; |
| 118 | public static final char TRIPLET = CP437[0xF0]; |
| 119 | public static final char OMEGA = CP437[0xEA]; |
| 120 | public static final char PI = CP437[0xE3]; |
| 121 | public static final char UPARROW = CP437[0x18]; |
| 122 | public static final char DOWNARROW = CP437[0x19]; |
| 123 | public static final char RIGHTARROW = CP437[0x1A]; |
| 124 | public static final char LEFTARROW = CP437[0x1B]; |
| 125 | public static final char SINGLE_BAR = CP437[0xC4]; |
| 126 | public static final char BACK_ARROWHEAD = CP437[0x11]; |
| 127 | public static final char LRCORNER = CP437[0xD9]; |
| 128 | public static final char URCORNER = CP437[0xBF]; |
| 129 | public static final char LLCORNER = CP437[0xC0]; |
| 130 | public static final char ULCORNER = CP437[0xDA]; |
| 131 | public static final char DEGREE = CP437[0xF8]; |
| 132 | public static final char PLUSMINUS = CP437[0xF1]; |
| 133 | public static final char WINDOW_TOP = CP437[0xCD]; |
| 134 | public static final char WINDOW_LEFT_TOP = CP437[0xD5]; |
| 135 | public static final char WINDOW_RIGHT_TOP = CP437[0xB8]; |
| 136 | public static final char WINDOW_SIDE = CP437[0xB3]; |
| 137 | public static final char WINDOW_LEFT_BOTTOM = CP437[0xD4]; |
| 138 | public static final char WINDOW_RIGHT_BOTTOM = CP437[0xBE]; |
| 139 | public static final char WINDOW_LEFT_TEE = CP437[0xC6]; |
| 140 | public static final char WINDOW_RIGHT_TEE = CP437[0xB5]; |
| 141 | public static final char WINDOW_SIDE_DOUBLE = CP437[0xBA]; |
| 142 | public static final char WINDOW_LEFT_TOP_DOUBLE = CP437[0xC9]; |
| 143 | public static final char WINDOW_RIGHT_TOP_DOUBLE = CP437[0xBB]; |
| 144 | public static final char WINDOW_LEFT_BOTTOM_DOUBLE = CP437[0xC8]; |
| 145 | public static final char WINDOW_RIGHT_BOTTOM_DOUBLE = CP437[0xBC]; |
| 146 | public static final char VERTICAL_BAR = CP437[0xB3]; |
| 147 | public static final char OCTOSTAR = CP437[0x0F]; |
| 148 | public static final char DOWNARROWLEFT = CP437[0xDD]; |
| 149 | public static final char DOWNARROWRIGHT = CP437[0xDE]; |
| 150 | |
| 151 | // ------------------------------------------------------------------------ |
| 152 | // Constructors ----------------------------------------------------------- |
| 153 | // ------------------------------------------------------------------------ |
| 154 | |
| 155 | /** |
| 156 | * Private constructor prevents accidental creation of this class. |
| 157 | */ |
| 158 | private GraphicsChars() { |
| 159 | } |
| 160 | |
| 161 | } |