Dmuse: Color and upper-ASCII codes
Contents
The Representation of Color in Dmuse Text Files
The design of the Dmuse screen has its origins in the old PC screen. The old PC screen, which was character based, used two bytes to represent each character cell on the screen: one byte for the character, and one for the color attributes. The color attribute byte had two parts: color of the foreground -- the letters, themselves -- and the color of the background -- the field on which the letters appeared. The Dmuse screen also uses this system to represent characters and their color attributes.
The ability to use different color combinations for characters has proven quite useful. The eye is quick to distinguish color, and this makes it easy to flag or highlight certain areas of the screen. But there needs to be a mechanism for coding this information for storage in a file; otherwise, no advantage would be gained in using colors, since this information would simply go away when the window was saved. The most direct way to store window data would be to store each cell: character and attribute. But this has two very large disadvantages. One, it is very wasteful, since most text is written in a "default" combination, e.g., white on black. Second, it makes the file very difficult to read by other programs, since only every other byte contains a valid character. The alternative used by Dmuse is to insert an escape sequence each time the color attribute in a line changes. Since these changes do not happen very often, the extra bytes do not add up to a lot of extra storage. And since the escape sequences come in blocks, they do not interfere with the characters, at least not on a massive scale.
The escape sequences used by Dmuse actually derive from those used by the old (c. 1965) HP 2640 Smart Terminal, on which the first Ibycus systems were based (see the History of Dmuse). Dmuse supports 16 different color combinations, which can be accessed by means of the four function keys, F5, F6, F7, F8, used with the four states: unaltered, Shft, Ctrl, and Ctrl+Shft. By convention, F5 is assigned the default combination, usually white on black. The table on the right shows the 16 escape codes used by Dmuse to flag these combination changes in a file, along with standard color assignments. <esc> here refers to the ASCII byte 27 (hex 0x1b).
|
In a plain ASCII text editor, a file created by Dmuse might display the following string (using ? to represent the escape byte, 0x1b):
?&dAThis combination is black on red.?&d@
which would be displayed in Dmuse as:
This combination is black on red
with "?&dA" indicating color combination 1 (black letters on a red background), and "?&d@" indicating color combination 0 (return to default colors).
The Use of Non-standard ASCII Codes in Dmuse Files
Byte values range from 0 to 255. For purposes of representing text in Western European alphabets, only a subset of these values is agreed upon by everyone to have a standard meaning. For reasons now lost to most of us, this is called standard ASCII. The subset includes the values 32 to 126, and a few additional values such as 27 (= escape), 13 (= carriage return), 10 (= line-feed), and 9 (= Tab).
When text files are used to represent data that is meant to be read by multiple programs running on a variety of computer platforms, it is absolutely essential that ONLY standard ASCII be used. But it would be a shame to limit screen applications such as Dmuse to the 100 or so standard ASCII characters. Dmuse, for example, can display each of the letters, a,e,i,o,u, A,E,I,O,U, with the acute accent, the grave, the circumflex, and the umlaut or dieresis. Since Dmuse can put only one character in a cell, that's 10 x 4 = 40 additional screen characters. Another example: Dmuse can draw lines and boxes with both single and double lines. Tables and diagrams made with these characters have many useful applications. It takes 40 special characters to do this. So Dmuse does make use of almost all of the 256 byte values, even though only 100 of these values have a standard meaning.
This means that text files generated by Dmuse can have non-standard ASCII bytes in them. These bytes have a clear and sensible meaning to Dmuse, but other programs will interpret them differently with what may look like nonsensible results. There is no problem so long as files generated by Dmuse for general export (MuseData files, for example) contain bytes only from the standard ASCII set. Files intended for use by Dmuse alone are not subject to this limitation. Below is a list of the byte codes used by Dmuse.
Dmuse byte code character mappings
Byte Code | char |
UTF-8 Hex |
HTML Entity |
Dmuse key command | Character description | |
---|---|---|---|---|---|---|
Dec | Hex | |||||
0 | 0x00 | 00 | � | no character | ||
1 | 0x01 | ♯ | E299AF | ♯ | Ctrl+Shft+A | musical sharp |
2 | 0x02 | ♭ | E299AD | ♭ | Ctrl+Shft+B | musical flat |
3 | 0x03 | ♮ | E299AE | ♮ | Ctrl+Shft+C | musical natural |
4 | 0x04 | ♦ | E299A6 | ♦ | Ctrl+Shft+D | centered diamond |
5 | 0x05 | ⎛ | E28E9B | ⎛ | Ctrl+Shft+E | top of the large open parenthesis |
6 | 0x06 | ⎝ | E28E9D | ⎝ | Ctrl+Shft+F | bottom of the large open parenthesis |
7 | 0x07 | • | E280A2 | • | Shft+Alt+9 | large centered dot |
8 | 0x08 | ⎞ | E28E9E | ⎞ | Ctrl+Shft+G | top of the large close parenthesis |
9 | 0x09 | ┊ | E2948A | ┊ | Shft+Alt+0 (zero) | vertical dotted line, also used to represent Tab character |
10 | 0x0a | 0A | | Shft+Alt+- (minus) | line feed | |
11 | 0x0b | © | C2A9 | © | Ctrl+Shft+K | copyright |
12 | 0x0c | ⎠ | E28EA0 | ⎠ | Ctrl+Shft+H | bottom of the large close parenthesis |
13 | 0x0d | 0D | | Ctrl+Shft+L | carriage return | |
14 | 0x0e | → | E28692 | → | Ctrl+Shft+M | small arrow pointing right |
15 | 0x0f | ☼ | E298BC | ☼ | Ctrl+Shft+O (letter) | sun burst |
16 | 0x10 | ► | E296BA | ► | Ctrl+Shft+P | large arrow head pointing right |
17 | 0x11 | ◄ | E29784 | ◄ | Ctrl+Shft+Q | large arrow head pointing left |
18 | 0x12 | √ | E2889A | √ | Ctrl+Shft+R | start of small square root character |
19 | 0x13 | ▁ | E29681 | ▁ | Ctrl+Shft+S | top of square root character |
20 | 0x14 | ¶ | C2B6 | ¶ | Ctrl+Shft+T | paragraph |
21 | 0x15 | § | C2A7 | § | Ctrl+Shft+U | section |
22 | 0x16 | ╱ | E295B1 | ╱ | Ctrl+Shft+V | vertical part of large square root |
23 | 0x17 | ╲ | E295B2 | ╲ | Ctrl+Shft+W | start of large square root |
24 | 0x18 | ↑ | E28691 | ↑ | Ctrl+Shft+X | small arrow pointing up |
25 | 0x19 | ↓ | E28693 | ↓ | Ctrl+Shft+Y | small arrow pointing down |
26 | 0x1a | ± | C2B1 | ± | Shft+Alt+= | plus or minus |
27 | 0x1b | 1B |  | escape character | ||
28 | 0x1c | ← | E28690 | ← | Ctrl+Shft+N | small arrow pointing left |
29 | 0x1d | ↔ | E28694 | ↔ | (none) | arrow both ways |
30 | 0x1e | ▲ | E296B2 | ▲ | Ctrl+Shft+I (letter) | large arrow head pointing up |
31 | 0x1f | ▼ | E296BC | ▼ | Ctrl+Shft+J | large arrow head pointing down |
32-126 | Standard keys | Standard ASCII characters | ||||
127 | 0x7f | ⌂ | E28C82 | ⌂ | Ctrl+Shft+Z | house |
128 | 0x80 | Ç | C387 | Ç | C then Alt+2 | C-cedilla |
129 | 0x81 | ü | C3BC | ü | u then Alt+3 | u-umlaut |
130 | 0x82 | é | C3A9 | é | e then Alt+7 | e-acute |
131 | 0x83 | â | C3A2 | â | a then Alt+9 | a-circumflex |
132 | 0x84 | ä | C3A4 | ä | a then Alt+3 | a-umlaut |
133 | 0x85 | à | C3A0 | à | a then Alt+8 | a-grave |
134 | 0x86 | å | C3A5 | å | a then Alt+4 | a-circle |
135 | 0x87 | ç | C3A7 | ç | c then Alt+2 | c-cedilla |
136 | 0x88 | ê | C3AA | ê | e then Alt+9 | e-circumflex |
137 | 0x89 | ë | C3AB | ë | e then Alt+3 | e-dieresis |
138 | 0x8a | è | C3A8 | è | e then Alt+8 | e-grave |
139 | 0x8b | ï | C3AF | ï | i then Alt+3 | i-dieresis |
140 | 0x8c | î | C3AE | î | i then Alt+9 | i-circumflex |
141 | 0x8d | ì | C3AC | ì | i then Alt+8 | i-grave |
142 | 0x8e | Ä | C384 | Ä | A then Alt+3 | A-umlaut |
143 | 0x8f | Å | C385 | Å | A then Alt+4 | A-circle |
144 | 0x90 | é | C3A9 | é | E then Alt+7 | E-acute |
145 | 0x91 | æ | C3A6 | æ | Shft+Alt+I (letter) | ae |
146 | 0x92 | Æ | C386 | Æ | Shft+Alt+O (letter) | AE |
147 | 0x93 | ô | C3B4 | ô | o then Alt+9 | o-circumflex |
148 | 0x94 | ö | C3B6 | ö | o then Alt+3 | o-umlaut |
149 | 0x95 | ò | C3B2 | ò | o then Alt+8 | o-grave |
150 | 0x96 | û | C3BB | û | u then Alt+9 | u-circumflex |
151 | 0x97 | ù | C3B9 | ù | u then Alt+8 | u-grave |
152 | 0x98 | ÿ | C3BF | ÿ | y then Alt+3 | y-dieresis |
153 | 0x99 | Ö | C396 | Ö | O then Alt+3 | O-umlaut |
154 | 0x9a | Ü | C39C | Ü | U then Alt+3 | U-umlaut |
155 | 0x9b | ¢ | C2A2 | ¢ | Shft+Alt+$ | cent |
156 | 0x9c | £ | C2A3 | £ | Shft+Alt+# | British pound |
157 | 0x9d | ¥ | C2A5 | ¥ | Shft+Alt+@ | Japanese yen |
158 | 0x9e | ₧ | E282A7 | ₧ | Shft+Alt+P | peseta |
159 | 0x9f | ƒ | C692 | ƒ | Shft+Alt+% | florin |
160 | 0xa0 | á | C3A1 | á | a then Alt+7 | a-acute |
161 | 0xa1 | í | C3AD | í | i then Alt+7 | i-acute |
162 | 0xa2 | ó | C3B3 | ó | o then Alt+7 | o-acute |
163 | 0xa3 | ú | C3BA | ú | u then Alt+7 | u-acute |
164 | 0xa4 | ñ | C3B1 | ñ | n then Alt+1 | n-tilde |
165 | 0xa5 | Ñ | C391 | Ñ | N then Alt+1 | N-tilde |
166 | 0xa6 | Ř | C598 | Ř | R then Alt+5 | R-caron |
167 | 0xa7 | ř | C599 | ř | r then Alt+5 | r-caron |
168 | 0xa8 | ¿ | C2BF | ¿ | Shft+Alt+? | inverted question |
169 | 0xa9 | ⌐ | E28C90 | ⌐ | Alt+= | right-angle up-left |
170 | 0xaa | ¬ | C2AC | ¬ | Alt+- | right-angle up-right |
171 | 0xab | ½ | C2BD | ½ | Shft+Alt+* | half |
172 | 0xac | ¼ | C2BC | ¼ | Shft+Alt+& | quarter |
173 | 0xad | ¡ | C2A1 | ¡ | Shft+Alt+! | inverted exclamation |
174 | 0xae | « | C2AB | « | Shft+Alt+< | left angle quote |
175 | 0xaf | » | C2BB | » | Shft+Alt+> | right angle quote |
176 | 0xb0 | ░ | E29691 | ░ | Alt+o | full cell quarter shade |
177 | 0xb1 | ▒ | E29692 | ▒ | Alt+p | full cell half shade |
178 | 0xb2 | ▓ | E29693 | ▓ | Alt+[ | full cell 3/4 shade |
179 | 0xb3 | │ | E29482 | │ | Alt+f | line drawing: single vertical line |
180 | 0xb4 | ┤ | E294A4 | ┤ | Alt+d | line drawing: single right-center |
181 | 0xb5 | ╡ | E295A1 | ╡ | Shft+Alt+J | line drawing: single/double right-center |
182 | 0xb6 | ╢ | E295A2 | ╢ | Shft+Alt+D | line drawing: double/single right-center |
183 | 0xb7 | ╖ | E29596 | ╖ | Shft+Alt+E | line drawing: double/single upper-right |
184 | 0xb8 | ╕ | E29595 | ╕ | Shft+Alt+U | line drawing: single/double upper-right |
185 | 0xb9 | ╣ | E295A3 | ╣ | Alt+j | line drawing: double right-center |
186 | 0xba | ║ | E29591 | ║ | Alt+k | line drawing: double vertical line |
187 | 0xbb | ╗ | E29597 | ╗ | Alt+u | line drawing: double upper-right |
188 | 0xbc | ╝ | E2959D | ╝ | Alt+m | line drawing: double lower-right |
189 | 0xbd | ╜ | E2959C | ╜ | Shft+Alt+C | line drawing: double/single lower-right |
190 | 0xbe | ╛ | E2959B | ╛ | Shft+Alt+M | line drawing: single/double lower-right |
191 | 0xbf | ┐ | E29490 | ┐ | Alt+e | line drawing: single upper-right |
192 | 0xc0 | └ | E29494 | └ | Alt+z | line drawing: single lower-left |
193 | 0xc1 | ┴ | E294B4 | ┴ | Alt+x | line drawing: single lower-center |
194 | 0xc2 | ┬ | E294AC | ┬ | Alt+w | line drawing: single upper-center |
195 | 0xc3 | ├ | E2949C | ├ | Alt+a | line drawing: single left-center |
196 | 0xc4 | ─ | E29480 | ─ | Alt+r | line drawing: single horizontal line |
197 | 0xc5 | ┼ | E294BC | ┼ | Alt+s | line drawing: single center |
198 | 0xc6 | ╞ | E2959E | ╞ | Shft+Alt+G | line drawing: single/double left-center |
199 | 0xc7 | ╟ | E2959F | ╟ | Shft+Alt+A | line drawing: double/single left-center |
200 | 0xc8 | ╚ | E2959A | ╚ | Alt+b | line drawing: double lower-left |
201 | 0xc9 | ╔ | E29594 | ╔ | Alt+t | line drawing: double upper-left |
202 | 0xca | ╩ | E295A9 | ╩ | Alt+n | line drawing: double lower-center |
203 | 0xcb | ╦ | E295A6 | ╦ | Alt+y | line drawing: double upper-center |
204 | 0xcc | ╠ | E295A0 | ╠ | Alt+g | line drawing: double left-center |
205 | 0xcd | ═ | E29590 | ═ | Alt+i | line drawing: double horizontal line |
206 | 0xce | ╬ | E295AC | ╬ | Alt+h | line drawing: double center |
207 | 0xcf | ╧ | E295A7 | ╧ | Shft+Alt+N | line drawing: single/double lower-center |
208 | 0xd0 | ╨ | E295A8 | ╨ | Shft+Alt+X | line drawing: double/single lower-center |
209 | 0xd1 | ╤ | E295A4 | ╤ | Shft+Alt+Y | line drawing: single/double upper-center |
210 | 0xd2 | ╥ | E295A5 | ╥ | Shft+Alt+W | line drawing: double/single upper-center |
211 | 0xd3 | ╙ | E29599 | ╙ | Shft+Alt+Z | line drawing: double/single lower-left |
212 | 0xd4 | ╘ | E29598 | ╘ | Shft+Alt+B | line drawing: single/double lower-left |
213 | 0xd5 | ╒ | E29592 | ╒ | Shft+Alt+T | line drawing: single/double upper-left |
214 | 0xd6 | ╓ | E29593 | ╓ | Shft+Alt+Q | line drawing: double-single upper-left |
215 | 0xd7 | ╫ | E295AB | ╫ | Shft+Alt+S | line drawing: double/single center |
216 | 0xd8 | ╪ | E295AA | ╪ | Shft+Alt+H | line drawing: single/double center |
217 | 0xd9 | ┘ | E29498 | ┘ | Alt+c | line drawing: single lower-right |
218 | 0xda | ┌ | E2948C | ┌ | Alt+q | line drawing: single upper-left |
219 | 0xdb | █ | E29688 | █ | Alt+] | full cell full shade |
220 | 0xdc | ▄ | E29684 | ▄ | Alt+; | lower-half cell full shade |
221 | 0xdd | ▌ | E2968C | ▌ | Alt+, | left-half cell full shade |
222 | 0xde | ▐ | E29690 | ▐ | Alt+. | right-half cell full shade |
223 | 0xdf | ▀ | E29680 | ▀ | Alt+l | upper-half cell full shade |
224 | 0xe0 | Â | C382 | Â | A then Alt+9 | A-circumflex |
225 | 0xe1 | À | C380 | À | A then Alt+8 | A-grave |
226 | 0xe2 | Á | C381 | Á | A then Alt+7 | A-acute |
227 | 0xe3 | Ê | C38A | Ê | E then Alt+9 | E-circumflex |
228 | 0xe4 | Ë | C38B | Ë | E then Alt+3 | E-dieresis |
229 | 0xe5 | È | C388 | È | E then Alt+8 | E-grave |
230 | 0xe6 | Î | C38E | Î | I then Alt+9 | I-circumflex |
231 | 0xe7 | Ì | C38C | Ì | I then Alt+8 | I-grave |
232 | 0xe8 | Í | C38D | Í | I then Alt+7 | I-acute |
233 | 0xe9 | Ï | C38F | Ï | I then Alt+3 | I-dieresis |
234 | 0xea | Ô | C394 | Ô | O then Alt+9 | O-circumflex |
235 | 0xeb | Ò | C392 | Ò | O then Alt+8 | O-grave |
236 | 0xec | Ó | C393 | Ó | O then Alt+7 | O-acute |
237 | 0xed | Û | C39B | Û | U then Alt+9 | U-circumflex |
238 | 0xee | Ù | C399 | Ù | U then Alt+8 | U-grave |
239 | 0xef | Ú | C39A | Ú | U then Alt+7 | U-acute |
240 | 0xf0 | Ÿ | C5B8 | Ÿ | Y then Alt+3 | Y-dieresis |
241 | 0xf1 | ý | C3BD | ý | y then Alt+7 | y-acute |
242 | 0xf2 | Ý | C39D | Ý | Y then Alt+7 | Y-acute |
243 | 0xf3 | ø | C3B8 | ø | o then Alt+2 | o-slash |
244 | 0xf4 | Ø | C398 | Ø | O then Alt+2 | O-slash |
245 | 0xf5 | õ | C3B5 | õ | o then Alt+1 | o-tilde |
246 | 0xf6 | Õ | C39520 | Õ | O then Alt+1 | O-tilde |
247 | 0xf7 | ß | C39F | ß | s then Alt+2 | German ss |
248 | 0xf8 | Š | C5A0 | Š | S then Alt+5 | S-caron |
249 | 0xf9 | š | C5A1 | š | s then Alt+5 | s-caron |
250 | 0xfa | · | C2B7 | · | Shft+Alt+] | small centered dot |
251 | 0xfb | Φ | CEA6 | Φ | (none) | small capital phi |
252 | 0xfc | Φ | CEA6 | Φ | (none) | large capital phi |
253 | 0xfd | ° | C2B0 | ° | Shft+Alt+^ | degree |
254 | 0xfe | ◾ | E297BE | ◾ | Shft+Alt+[ | centered box |
255 | 0xff | ▂ | E29682 | ▂ | (none) | cursor |
The following screen shot of Dmuse show the contents of this .dm file (HTML conversion) which contains a list of each byte code as it is displayed in Dmuse (when the Dmuse fonts have been installed correctly for X11).
Conversion from Dmuse text files to HTML files
This PERL program can be used to convert files using Dmuse byte code representation and color escape codes into a visually similar HTML file. Not all of the Unicode characters which map into Dmuse characters have fixed-width forms, so there may be slight mis-alignment between characters in the same column. Here are example files and screenshots of the Dmuse and HTML files:
The program can be run from the command-line in a unix-style computer terminal like this:
./dmuse2html file.dm > file.html
Dmuse ASCII Artwork
|