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. Here is a list of the byte codes used by Dmuse.
Byte Code | char |
HTML Entity |
Dmuse key command | Character description | |
---|---|---|---|---|---|
Dec | Hex | ||||
0 | 0x00 | � | no character | ||
1 | 0x01 | ♯ | ♯ | Ctrl+Shft+A | musical sharp |
2 | 0x02 | ♭ | ♭ | Ctrl+Shft+B | musical flat |
3 | 0x03 | ♮ | ♮ | Ctrl+Shft+C | musical natural |
4 | 0x04 | ♦ | ♦ | Ctrl+Shft+D | centered diamond |
5 | 0x05 | ⎛ | ⎛ | Ctrl+Shft+E | top of the large open parenthesis |
6 | 0x06 | ⎝ | ⎝ | Ctrl+Shft+F | bottom of the large open parenthesis |
7 | 0x07 | • | • | Shft+Alt+9 | large centered dot |
8 | 0x08 | ⎞ | ⎞ | Ctrl+Shft+G | top of the large close parenthesis |
9 | 0x09 | ┊ | ┊ | Shft+Alt+0 (zero) | vertical dotted line, also used to represent Tab character |
10 | 0x0a | | Shft+Alt+- (minus) | line feed | |
11 | 0x0b | © | © | Ctrl+Shft+K | copyright |
12 | 0x0c | ⎠ | ⎠ | Ctrl+Shft+H | bottom of the large close parenthesis |
13 | 0x0d | | Ctrl+Shft+L | carriage return | |
14 | 0x0e | → | → | Ctrl+Shft+M | small arrow pointing right |
15 | 0x0f | ☼ | ☼ | Ctrl+Shft+O (letter) | sun burst |
16 | 0x10 | ► | ► | Ctrl+Shft+P | large arrow head pointing right |
17 | 0x11 | ◄ | ◄ | Ctrl+Shft+Q | large arrow head pointing left |
18 | 0x12 | √ | √ | Ctrl+Shft+R | start of small square root character |
19 | 0x13 | ▁ | ▁ | Ctrl+Shft+S | top of square root character |
20 | 0x14 | ¶ | ¶ | Ctrl+Shft+T | paragraph |
21 | 0x15 | § | § | Ctrl+Shft+U | section |
22 | 0x16 | ╱ | ╱ | Ctrl+Shft+V | vertical part of large square root |
23 | 0x17 | ╲ | ╲ | Ctrl+Shft+W | start of large square root |
24 | 0x18 | ↑ | ↑ | Ctrl+Shft+X | small arrow pointing up |
25 | 0x19 | ↓ | ↓ | Ctrl+Shft+Y | small arrow pointing down |
26 | 0x1a | ± | ± | Shft+Alt+= | plus or minus |
27 | 0x1b | escape character | |||
28 | 0x1c | ← | ← | Ctrl+Shft+N | small arrow pointing left |
29 | 0x1d | ↔ | ↔ | (none) | arrow both ways |
30 | 0x1e | ▲ | ▲ | Ctrl+Shft+I (letter) | large arrow head pointing up |
31 | 0x1f | ▼ | ▼ | Ctrl+Shft+J | large arrow head pointing down |
32-126 | Standard keys | Standard ASCII characters | |||
127 | 0x7f | ⌂ | ⌂ | Ctrl+Shft+Z | house |
128 | 0x80 | Ç | Ç | C then Alt+2 | C-cedilla |
129 | 0x81 | ü | ü | u then Alt+3 | u-umlaut |
130 | 0x82 | é | é | e then Alt+7 | e-acute |
131 | 0x83 | â | â | a then Alt+9 | a-circumflex |
132 | 0x84 | ä | ä | a then Alt+3 | a-umlaut |
133 | 0x85 | à | à | a then Alt+8 | a-grave |
134 | 0x86 | å | å | a then Alt+4 | a-circle |
135 | 0x87 | ç | ç | c then Alt+2 | c-cedilla |
136 | 0x88 | ê | ê | e then Alt+9 | e-circumflex |
137 | 0x89 | ë | ë | e then Alt+3 | e-dieresis |
138 | 0x8a | è | è | e then Alt+8 | e-grave |
139 | 0x8b | ï | ï | i then Alt+3 | i-dieresis |
140 | 0x8c | î | î | i then Alt+9 | i-circumflex |
141 | 0x8d | ì | ì | i then Alt+8 | i-grave |
142 | 0x8e | Ä | Ä | A then Alt+3 | A-umlaut |
143 | 0x8f | Å | Å | A then Alt+4 | A-circle |
144 | 0x90 | é | é | E then Alt+7 | E-acute |
145 | 0x91 | æ | æ | Shft+Alt+I (letter) | ae |
146 | 0x92 | Æ | Æ | Shft+Alt+O (letter) | AE |
147 | 0x93 | ô | ô | o then Alt+9 | o-circumflex |
148 | 0x94 | ö | ö | o then Alt+3 | o-umlaut |
149 | 0x95 | ò | ò | o then Alt+8 | o-grave |
150 | 0x96 | û | û | u then Alt+9 | u-circumflex |
151 | 0x97 | ù | ù | u then Alt+8 | u-grave |
152 | 0x98 | ÿ | ÿ | y then Alt+3 | y-dieresis |
153 | 0x99 | Ö | Ö | O then Alt+3 | O-umlaut |
154 | 0x9a | Ü | Ü | U then Alt+3 | U-umlaut |
155 | 0x9b | ¢ | ¢ | Shft+Alt+$ | cent |
156 | 0x9c | £ | £ | Shft+Alt+# | British pound |
157 | 0x9d | ¥ | ¥ | Shft+Alt+@ | Japanese yen |
158 | 0x9e | ₧ | ₧ | Shft+Alt+P | peseta |
159 | 0x9f | ƒ | ƒ | Shft+Alt+% | florin |
160 | 0xa0 | á | á | a then Alt+7 | a-acute |
161 | 0xa1 | í | í | i then Alt+7 | i-acute |
162 | 0xa2 | ó | ó | o then Alt+7 | o-acute |
163 | 0xa3 | ú | ú | u then Alt+7 | u-acute |
164 | 0xa4 | ñ | ñ | n then Alt+1 | n-tilde |
165 | 0xa5 | Ñ | Ñ | N then Alt+1 | N-tilde |
166 | 0xa6 | Ř | Ř | R then Alt+5 | R-caron |
167 | 0xa7 | ř | ř | r then Alt+5 | r-caron |
168 | 0xa8 | ¿ | ¿ | Shft+Alt+? | inverted question |
169 | 0xa9 | ⌐ | ⌐ | Alt+= | right-angle up-left |
170 | 0xaa | ¬ | ¬ | Alt+- | right-angle up-right |
171 | 0xab | ½ | ½ | Shft+Alt+* | half |
172 | 0xac | ¼ | ¼ | Shft+Alt+& | quarter |
173 | 0xad | ¡ | ¡ | Shft+Alt+! | inverted exclamation |
174 | 0xae | « | « | Shft+Alt+< | left angle quote |
175 | 0xaf | » | » | Shft+Alt+> | right angle quote |
176 | 0xb0 | ░ | ░ | Alt+o | full cell quarter shade |
177 | 0xb1 | ▒ | ▒ | Alt+p | full cell half shade |
178 | 0xb2 | ▓ | ▓ | Alt+[ | full cell 3/4 shade |
179 | 0xb3 | │ | │ | Alt+f | line drawing: single vertical line |
180 | 0xb4 | ┤ | ┤ | Alt+d | line drawing: single right-center |
181 | 0xb5 | ╡ | ╡ | Shft+Alt+J | line drawing: single/double right-center |
182 | 0xb6 | ╢ | ╢ | Shft+Alt+D | line drawing: double/single right-center |
183 | 0xb7 | ╖ | ╖ | Shft+Alt+E | line drawing: double/single upper-right |
184 | 0xb8 | ╕ | ╕ | Shft+Alt+U | line drawing: single/double upper-right |
185 | 0xb9 | ╣ | ╣ | Alt+j | line drawing: double right-center |
186 | 0xba | ║ | ║ | Alt+k | line drawing: double vertical line |
187 | 0xbb | ╗ | ╗ | Alt+u | line drawing: double upper-right |
188 | 0xbc | ╝ | ╝ | Alt+m | line drawing: double lower-right |
189 | 0xbd | ╜ | ╜ | Shft+Alt+C | line drawing: double/single lower-right |
190 | 0xbe | ╛ | ╛ | Shft+Alt+M | line drawing: single/double lower-right |
191 | 0xbf | ┐ | ┐ | Alt+e | line drawing: single upper-right |
192 | 0xc0 | └ | └ | Alt+z | line drawing: single lower-left |
193 | 0xc1 | ┴ | ┴ | Alt+x | line drawing: single lower-center |
194 | 0xc2 | ┬ | ┬ | Alt+w | line drawing: single upper-center |
195 | 0xc3 | ├ | ├ | Alt+a | line drawing: single left-center |
196 | 0xc4 | ─ | ─ | Alt+r | line drawing: single horizontal line |
197 | 0xc5 | ┼ | ┼ | Alt+s | line drawing: single center |
198 | 0xc6 | ╞ | ╞ | Shft+Alt+G | line drawing: single/double left-center |
199 | 0xc7 | ╟ | ╟ | Shft+Alt+A | line drawing: double/single left-center |
200 | 0xc8 | ╚ | ╚ | Alt+b | line drawing: double lower-left |
201 | 0xc9 | ╔ | ╔ | Alt+t | line drawing: double upper-left |
202 | 0xca | ╩ | ╩ | Alt+n | line drawing: double lower-center |
203 | 0xcb | ╦ | ╦ | Alt+y | line drawing: double upper-center |
204 | 0xcc | ╠ | ╠ | Alt+g | line drawing: double left-center |
205 | 0xcd | ═ | ═ | Alt+i | line drawing: double horizontal line |
206 | 0xce | ╬ | ╬ | Alt+h | line drawing: double center |
207 | 0xcf | ╧ | ╧ | Shft+Alt+N | line drawing: single/double lower-center |
208 | 0xd0 | ╨ | ╨ | Shft+Alt+X | line drawing: double/single lower-center |
209 | 0xd1 | ╤ | ╤ | Shft+Alt+Y | line drawing: single/double upper-center |
210 | 0xd2 | ╥ | ╥ | Shft+Alt+W | line drawing: double/single upper-center |
211 | 0xd3 | ╙ | ╙ | Shft+Alt+Z | line drawing: double/single lower-left |
212 | 0xd4 | ╘ | ╘ | Shft+Alt+B | line drawing: single/double lower-left |
213 | 0xd5 | ╒ | ╒ | Shft+Alt+T | line drawing: single/double upper-left |
214 | 0xd6 | ╓ | ╓ | Shft+Alt+Q | line drawing: double-single upper-left |
215 | 0xd7 | ╫ | ╫ | Shft+Alt+S | line drawing: double/single center |
216 | 0xd8 | ╪ | ╪ | Shft+Alt+H | line drawing: single/double center |
217 | 0xd9 | ┘ | ┘ | Alt+c | line drawing: single lower-right |
218 | 0xda | ┌ | ┌ | Alt+q | line drawing: single upper-left |
219 | 0xdb | █ | █ | Alt+] | full cell full shade |
220 | 0xdc | ▄ | ▄ | Alt+; | lower-half cell full shade |
221 | 0xdd | ▌ | ▌ | Alt+, | left-half cell full shade |
222 | 0xde | ▐ | ▐ | Alt+. | right-half cell full shade |
223 | 0xdf | ▀ | ▀ | Alt+l | upper-half cell full shade |
224 | 0xe0 | Â | Â | A then Alt+9 | A-circumflex |
225 | 0xe1 | À | À | A then Alt+8 | A-grave |
226 | 0xe2 | Á | Á | A then Alt+7 | A-acute |
227 | 0xe3 | Ê | Ê | E then Alt+9 | E-circumflex |
228 | 0xe4 | Ë | Ë | E then Alt+3 | E-dieresis |
229 | 0xe5 | È | È | E then Alt+8 | E-grave |
230 | 0xe6 | Î | Î | I then Alt+9 | I-circumflex |
231 | 0xe7 | Ì | Ì | I then Alt+8 | I-grave |
232 | 0xe8 | Í | Í | I then Alt+7 | I-acute |
233 | 0xe9 | Ï | Ï | I then Alt+3 | I-dieresis |
234 | 0xea | Ô | Ô | O then Alt+9 | O-circumflex |
235 | 0xeb | Ò | Ò | O then Alt+8 | O-grave |
236 | 0xec | Ó | Ó | O then Alt+7 | O-acute |
237 | 0xed | Û | Û | U then Alt+9 | U-circumflex |
238 | 0xee | Ù | Ù | U then Alt+8 | U-grave |
239 | 0xef | Ú | Ú | U then Alt+7 | U-acute |
240 | 0xf0 | Ÿ | Ÿ | Y then Alt+3 | Y-dieresis |
241 | 0xf1 | ý | ý | y then Alt+7 | y-acute |
242 | 0xf2 | Ý | Ý | Y then Alt+7 | Y-acute |
243 | 0xf3 | ø | ø | o then Alt+2 | o-slash |
244 | 0xf4 | Ø | Ø | O then Alt+2 | O-slash |
245 | 0xf5 | õ | õ | o then Alt+1 | o-tilde |
246 | 0xf6 | Õ | Õ | O then Alt+1 | O-tilde |
247 | 0xf7 | ß | ß | s then Alt+2 | German ss |
248 | 0xf8 | Š | Š | S then Alt+5 | S-caron |
249 | 0xf9 | š | š | s then Alt+5 | s-caron |
250 | 0xfa | · | · | Shft+Alt+] | small centered dot |
251 | 0xfb | Φ | Φ | (none) | small capital phi |
252 | 0xfc | Φ | Φ | (none) | large capital phi |
253 | 0xfd | ° | ° | Shft+Alt+^ | degree |
254 | 0xfe | ◾ | ◾ | Shft+Alt+[ | centered box |
255 | 0xff | ▂ | ▂ | (none) | cursor |
The following screen shot of Dmuse show the contents of this file which contains a list of each byte code as it is displayed in Dmuse (when the Dmuse fonts have been installed correctly for X11).