Box-drawing characters
Box-drawing characters, also known as line-drawing characters, are a form of
In graphical user interfaces, these characters are much less useful as it is more simple and appropriate to draw lines and rectangles directly with graphical APIs. However, they are still useful for command-line interfaces and plaintext comments within source code.
Some recent embedded systems also use proprietary character sets, usually extensions to
Other types of box-drawing characters are
Unicode
Box Drawing
Box Drawing[1] Official Unicode Consortium code chart (PDF) | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
U+250x | ─ | ━ | │ | ┃ | ┄ | ┅ | ┆ | ┇ | ┈ | ┉ | ┊ | ┋ | ┌ | ┍ | ┎ | ┏ |
U+251x | ┐ | ┑ | ┒ | ┓ | └ | ┕ | ┖ | ┗ | ┘ | ┙ | ┚ | ┛ | ├ | ┝ | ┞ | ┟ |
U+252x | ┠ | ┡ | ┢ | ┣ | ┤ | ┥ | ┦ | ┧ | ┨ | ┩ | ┪ | ┫ | ┬ | ┭ | ┮ | ┯ |
U+253x | ┰ | ┱ | ┲ | ┳ | ┴ | ┵ | ┶ | ┷ | ┸ | ┹ | ┺ | ┻ | ┼ | ┽ | ┾ | ┿ |
U+254x | ╀ | ╁ | ╂ | ╃ | ╄ | ╅ | ╆ | ╇ | ╈ | ╉ | ╊ | ╋ | ╌ | ╍ | ╎ | ╏ |
U+255x | ═ | ║ | ╒ | ╓ | ╔ | ╕ | ╖ | ╗ | ╘ | ╙ | ╚ | ╛ | ╜ | ╝ | ╞ | ╟ |
U+256x | ╠ | ╡ | ╢ | ╣ | ╤ | ╥ | ╦ | ╧ | ╨ | ╩ | ╪ | ╫ | ╬ | ╭ | ╮ | ╯ |
U+257x | ╰ | ╱ | ╲ | ╳ | ╴ | ╵ | ╶ | ╷ | ╸ | ╹ | ╺ | ╻ | ╼ | ╽ | ╾ | ╿ |
Notes
|
The image below is provided as a quick reference for these symbols on systems that are unable to display them directly:
Block Elements
The Block Elements Unicode block includes shading characters. 32 characters are included in the block.
Block Elements[1] Official Unicode Consortium code chart (PDF) | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
U+258x | ▀ | ▁ | ▂ | ▃ | ▄ | ▅ | ▆ | ▇ | █ | ▉ | ▊ | ▋ | ▌ | ▍ | ▎ | ▏ |
U+259x | ▐ | ░ | ▒ | ▓ | ▔ | ▕ | ▖ | ▗ | ▘ | ▙ | ▚ | ▛ | ▜ | ▝ | ▞ | ▟ |
Notes
|
Symbols for Legacy Computing
In version 13.0, Unicode was extended with another block containing many graphics characters, Symbols for Legacy Computing, which includes a few box-drawing characters and other symbols used by obsolete operating systems (mostly from the 1980s). Few fonts support these characters, but the table of symbols is provided here:
Symbols for Legacy Computing[1][2] Official Unicode Consortium code chart (PDF) | ||||||||||||||||
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
U+1FB0x | 🬀 | 🬁 | 🬂 | 🬃 | 🬄 | 🬅 | 🬆 | 🬇 | 🬈 | 🬉 | 🬊 | 🬋 | 🬌 | 🬍 | 🬎 | 🬏 |
U+1FB1x | 🬐 | 🬑 | 🬒 | 🬓 | 🬔 | 🬕 | 🬖 | 🬗 | 🬘 | 🬙 | 🬚 | 🬛 | 🬜 | 🬝 | 🬞 | 🬟 |
U+1FB2x | 🬠 | 🬡 | 🬢 | 🬣 | 🬤 | 🬥 | 🬦 | 🬧 | 🬨 | 🬩 | 🬪 | 🬫 | 🬬 | 🬭 | 🬮 | 🬯 |
U+1FB3x | 🬰 | 🬱 | 🬲 | 🬳 | 🬴 | 🬵 | 🬶 | 🬷 | 🬸 | 🬹 | 🬺 | 🬻 | 🬼 | 🬽 | 🬾 | 🬿 |
U+1FB4x | 🭀 | 🭁 | 🭂 | 🭃 | 🭄 | 🭅 | 🭆 | 🭇 | 🭈 | 🭉 | 🭊 | 🭋 | 🭌 | 🭍 | 🭎 | 🭏 |
U+1FB5x | 🭐 | 🭑 | 🭒 | 🭓 | 🭔 | 🭕 | 🭖 | 🭗 | 🭘 | 🭙 | 🭚 | 🭛 | 🭜 | 🭝 | 🭞 | 🭟 |
U+1FB6x | 🭠 | 🭡 | 🭢 | 🭣 | 🭤 | 🭥 | 🭦 | 🭧 | 🭨 | 🭩 | 🭪 | 🭫 | 🭬 | 🭭 | 🭮 | 🭯 |
U+1FB7x | 🭰 | 🭱 | 🭲 | 🭳 | 🭴 | 🭵 | 🭶 | 🭷 | 🭸 | 🭹 | 🭺 | 🭻 | 🭼 | 🭽 | 🭾 | 🭿 |
U+1FB8x | 🮀 | 🮁 | 🮂 | 🮃 | 🮄 | 🮅 | 🮆 | 🮇 | 🮈 | 🮉 | 🮊 | 🮋 | 🮌 | 🮍 | 🮎 | 🮏 |
U+1FB9x | 🮐 | 🮑 | 🮒 | 🮔 | 🮕 | 🮖 | 🮗 | 🮘 | 🮙 | 🮚 | 🮛 | 🮜 | 🮝 | 🮞 | 🮟 | |
U+1FBAx | 🮠 | 🮡 | 🮢 | 🮣 | 🮤 | 🮥 | 🮦 | 🮧 | 🮨 | 🮩 | 🮪 | 🮫 | 🮬 | 🮭 | 🮮 | 🮯 |
U+1FBBx | 🮰 | 🮱 | 🮲 | 🮳 | 🮴 | 🮵 | 🮶 | 🮷 | 🮸 | 🮹 | 🮺 | 🮻 | 🮼 | 🮽 | 🮾 | 🮿 |
U+1FBCx | 🯀 | 🯁 | 🯂 | 🯃 | 🯄 | 🯅 | 🯆 | 🯇 | 🯈 | 🯉 | 🯊 | |||||
U+1FBDx | ||||||||||||||||
U+1FBEx | ||||||||||||||||
U+1FBFx | 🯰 | 🯱 | 🯲 | 🯳 | 🯴 | 🯵 | 🯶 | 🯷 | 🯸 | 🯹 | ||||||
Notes |
The image below is provided as a quick reference for these symbols on systems that are unable to display them directly:
Platform-specific
Various different platforms defined their own unique set of box-drawing characters.
DOS
The
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | ░ | ▒ | ▓ | │ | ┤ | ╡ | ╢ | ╖ | ╕ | ╣ | ║ | ╗ | ╝ | ╜ | ╛ | ┐ |
C | └ | ┴ | ┬ | ├ | ─ | ┼ | ╞ | ╟ | ╚ | ╔ | ╩ | ╦ | ╠ | ═ | ╬ | ╧ |
D | ╨ | ╤ | ╥ | ╙ | ╘ | ╒ | ╓ | ╫ | ╪ | ┘ | ┌ | █ | ▄ | ▌ | ▐ | ▀ |
The integral halves are also box drawing as they are used alongside 0xB3:
4 | 5 | |
---|---|---|
F | ⌠ | ⌡ |
Their number is further limited to 28 on those code pages that replace the 18 characters that combine single and double lines, the left and right half blocks, as well as integral halves with other, usually alphabetic, characters (such as code page 850):
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | ░ | ▒ | ▓ | │ | ┤ | ╣ | ║ | ╗ | ╝ | ┐ | ||||||
C | └ | ┴ | ┬ | ├ | ─ | ┼ | ╚ | ╔ | ╩ | ╦ | ╠ | ═ | ╬ | |||
D | ┘ | ┌ | █ | ▄ | ▀ |
Note: The non-double characters are the thin (light) characters (U+2500, U+2502), not the bold (heavy) characters (U+2501, U+2503).
Some OEM DOS computers supported other character sets, for example the
[2][3] | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | ╝ | ╗ | ╔ | ╚ | ╣ | ╩ | ╦ | ╠ | ═ | ║ | ╬ | |||||
9 | ▀ | ▄ | ┘ | ┐ | ┌ | └ | ┤ | ┴ | ┬ | ├ | ─ | │ | ┼ | █ |
Unix, CP/M, BBS
On many Unix systems and early dial-up bulletin board systems the only common standard for box-drawing characters was the VT100 alternate character set (see also: DEC Special Graphics). The escape sequence Esc ( 0
switched the codes for lower-case ASCII letters to draw this set, and the sequence Esc ( B
switched back:
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | ┘ | ┐ | ┌ | └ | ┼ | |||||||||||
7 | ─ | ├ | ┤ | ┴ | ┬ | │ |
On some terminals, these characters are not available at all, and the complexity of the escape sequences discouraged their use, so often only
Modern Unix terminal emulators use Unicode and thus have access to the line-drawing characters listed above.
Teletext
The World System Teletext (WST) uses pixel-drawing characters for some graphics. A character cell is divided in 2×3 regions, and 26 = 64 code positions are allocated for all possible combinations of pixels.[4] These characters were added to the Unicode standard in Version 13.[5]
Historical
Many microcomputers of the 1970s and 1980s had their own proprietary character sets, which also included box-drawing characters. Many of these were added to Unicode as Symbols for Legacy Computing.
Commodore
Commodore machines, such as the Commodore PET and the Commodore 64, included a set of text semigraphics with block elements and dithering patterns in the PETSCII character set.
Sinclair
The
BBC and Acorn
The
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | ||||||||||||||||
3 | ||||||||||||||||
6 | ||||||||||||||||
7 |
The BBC Master and later Acorn computers have the soft font by default defined with line drawing characters.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | ╷ | ╶ | ┌ | ╴ | ┐ | ─ | ┬ | ╵ | │ | └ | ├ | ┘ | ┤ | ┴ | ┼ | |
B | ╭ | ╮ | ╰ | ╯ |
Amstrad
The Amstrad CPC character set also has soft characters defined by default as block and line drawing characters.
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | ▘ | ▝ | ▀ | ▖ | ▍ | ▞ | ▛ | ▗ | ▚ | ▐ | ▜ | ▃ | ▙ | ▟ | ▉ | |
9 | ╵ | ╶ | └ | ╷ | │ | ┌ | ├ | ╴ | ┘ | ─ | ┴ | ┐ | ┤ | ┬ | ┼ |
The
[8] | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | ╧ | ╟ | ╚ | ╤ | ║ | ╔ | ╠ | ╢ | ╝ | ═ | ╩ | ╗ | ╣ | ╦ | ╬ | |
9 | ╵ | ╶ | └ | ╷ | │ | ┌ | ├ | ╴ | ┘ | ─ | ┴ | ┐ | ┤ | ┬ | ┼ |
Apple
MouseText is a set of display characters for the Apple IIc, IIe, and IIGS that includes box-drawing characters.
Encoding
On many platforms, the character shape is determined programmatically from the character code.
- ZX Spectrum block characters:
0x80 + topright*1 + topleft*2 + bottomright*4 + bottomleft*8
- Amstrad CPC block characters:
0x80 + topleft*1 + topright*2 + bottomleft*4 + bottomright*8
- Amstrad CPC line characters:
0x90 + up*1 + right*2 + down*4 + left*8
- BBC Master line characters:
0xA0 + down*1 + right*2 + left*4 + up*8
- Teletext block characters:
0xA0 + topleft*1 + topright*2 + middleleft*4 + middleright*8 + bottomleft*16 + bottomright*64
However, DOS line- and box-drawing characters are not ordered in any programmatic manner, so calculating a particular character shape needs to use a look-up table.
Examples
Sample diagrams made out of the standard box-drawing characters, using a monospaced font:
┌─┬┐ ╔═╦╗ ╓─╥╖ ╒═╤╕ │ ││ ║ ║║ ║ ║║ │ ││ ├─┼┤ ╠═╬╣ ╟─╫╢ ╞═╪╡ └─┴┘ ╚═╩╝ ╙─╨╜ ╘═╧╛ ┌───────────────────┐ │ ╔═══╗ Some Text │▒ │ ╚═╦═╝ in the box │▒ ╞═╤══╩══╤═══════════╡▒ │ ├──┬──┤ │▒ │ └──┴──┘ │▒ └───────────────────┘▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
See also
- Unicode symbols
- Dingbat
- Box Drawing (Unicode Block)
- Block Elements (Unicode Block)
- Geometric Shapes (Unicode Block)
- List of Unicode characters
- Text-based (computing)
- Text semigraphics
- ASCII art and ANSI art
- MouseText
- Halfwidth and fullwidth forms (Unicode block)for the halfwidth version of U+2502 │ BOX DRAWINGS LIGHT VERTICAL (U+FFE8 │ HALFWIDTH FORMS LIGHT VERTICAL)
References
- ^ Box Drawing U+2500-U+257F, The Unicode Standard Code Charts
- ^ Hewlett-Packard Company, Portable Computer Division. August 1985. 45559-90001. Retrieved 2016-11-27.
- ^ Hewlett-Packard Company. December 1986 [August 1985]. 45559-90006. Archived(PDF) from the original on 2016-11-28. Retrieved 2016-11-27.
- ^ Wiels. "TeleText - Het Protocol" (in Dutch). Mosaic characters. Archived from the original on 2017-12-22. Retrieved 2017-12-21.
- ^ "Symbols for Legacy Computing" (PDF). Unicode Consortium. Retrieved 2020-04-19.
- ^ Broadcast Teletext Specification, September 1976 (as HTML or scans of original document)
- ^ Enhanced Teletext specification (PDF), European Telecommunications Standards Institute, May 1997, p. 126
- ^ a b "Appendix II: CP/M Plus character sets / II.1 The complete character set (Language 0)". Spectrum +3 CP/M Plus manual (User Manual). Archived from the original on 2009-10-15. Retrieved 2017-07-10. [1]
- ^ Elliott, John C. (2015-04-04). "Amstrad Extended BIOS Internals". Seasip.info. Archived from the original on 2017-07-15. Retrieved 2017-07-15.
- ^ "Amstrad CP/M Plus character set". Archived from the original on 2017-07-15. Retrieved 2017-07-15.