HOME

TheInfoList



OR:

Box-drawing characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw various geometric frames and boxes. Box-drawing characters typically only work well with monospaced fonts. 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 Comment may refer to: * Comment (linguistics) or rheme, that which is said about the topic (theme) of a sentence * Bernard Comment (born 1960), Swiss writer and publisher Computing * Comment (computer programming), explanatory text or informa ...
within
source code In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
. Used along with box-drawing characters are block elements, shade characters, and terminal graphic characters, these can be used for filling regions of the screen and portraying drop shadows.


Encodings


Unicode


Box Drawing

Unicode Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
includes 128 such characters in the
Box Drawing Box Drawing is a Unicode block containing characters for compatibility with legacy graphics standards that contained characters for making bordered charts and tables, i.e. box-drawing characters. Its block name in Unicode 1.0 was Form and Chart C ...
block. In many Unicode fonts only the subset that is also available in the
IBM PC The IBM Personal Computer (model 5150, commonly known as the IBM PC) is the first microcomputer released in the IBM PC model line and the basis for the IBM PC compatible de facto standard. Released on August 12, 1981, it was created by a team ...
character set (see below) will exist, due to it being defined as part of the
WGL4 Windows Glyph List 4, or more commonly WGL4 for short, also known as the ''Pan-European character set'', is a character repertoire on Microsoft operating systems comprising 657 Unicode characters, two of them private use. Its purpose is to provide ...
character set. 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.


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): The image below is provided as a quick reference for these symbols on systems that are unable to display them directly: :


DOS

The
hardware code page In computing, a hardware code page (HWCP) refers to a code page supported natively by a hardware device such as a display adapter or printer. The glyphs to present the characters are stored in the alphanumeric character generator's resident r ...
of the original IBM PC supplied the following box-drawing characters, in what DOS now calls code page 437. This subset of the Unicode box-drawing characters is thus far more popular and likely to be rendered correctly: Their number is further limited to 22 on those code pages that replace the 18 characters that combine single and double lines with other, usually alphabetic, characters (such as code page 850): 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
Hewlett-Packard The Hewlett-Packard Company, commonly shortened to Hewlett-Packard ( ) or HP, was an American multinational information technology company headquartered in Palo Alto, California. HP developed and provided a wide variety of hardware componen ...
HP 110 / HP Portable and HP 110 Plus / HP Portable Plus, where in a modified version of the character set box-drawing characters were added in reserved areas of their normal
HP Roman-8 In computing HP Roman is a family of character sets consisting of HP Roman Extension, HP Roman-8, HP Roman-9 and several variants. Originally introduced by Hewlett-Packard around 1978, revisions and adaptations were published several times up t ...
character set.


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: A Bash script that displays all of the semigraphic characters: $ for i in 6a 6b 6c 6d 6e 71 74 75 76 77 78; do printf "0x$i \x$i \x1b(0\x$i\x1b(B\n"; done 0x6a j ┘ 0x6b k ┐ 0x6c l ┌ 0x6d m └ 0x6e n ┼ 0x71 q ─ 0x74 t ├ 0x75 u ┤ 0x76 v ┴ 0x77 w ┬ 0x78 x │ On some terminals, these characters are not available at all, and the complexity of the escape sequences discouraged their use, so often only
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
characters that approximate box-drawing characters are used, such as - (
hyphen-minus The hyphen-minus is the most commonly used type of hyphen, widely used in digital documents. It is the only character that looks like a minus sign or a dash in many character sets such as ASCII or on most keyboards, so it is also used as such. ...
), ,  (
vertical bar The vertical bar, , is a glyph with various uses in mathematics, computing, and typography. It has many names, often related to particular meanings: Sheffer stroke (in logic), pipe, bar, or (literally the word "or"), vbar, and others. Usage ...
), _( underscore), =( equal sign) and + (
plus sign The plus and minus signs, and , are mathematical symbols used to represent the notions of positive and negative, respectively. In addition, represents the operation of addition, which results in a sum, while represents subtraction, result ...
) in a kind of
ASCII art ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable (from a total of 128) character (computing), characters defined by the ASCII Standard from 1963 an ...
fashion. Modern Unix terminal emulators use Unicode and thus have access to the line-drawing characters listed above.


Historical

Many
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (PC ...
s of the 1970s and 1980s had their own proprietary character sets, which also included box-drawing characters. Some of these sets, such as Commodore's PETSCII, include box-drawing symbols with no corresponding Unicode character.


Sinclair

The Sinclair ZX80, ZX81 and
Spectrum A spectrum (plural ''spectra'' or ''spectrums'') is a condition that is not limited to a specific set of values but can vary, without gaps, across a continuum. The word was first used scientifically in optics to describe the rainbow of color ...
included a set of text semigraphics with block elements and dithering patterns in the ZX80 character set.


BBC and Acorn

The BBC Micro could utilize the Teletext 7-bit character set, which had 128 box-drawing characters, whose code points were shared with the regular alphanumeric and punctuation characters. Control characters were used to switch between regular text and box drawing. Teletext G1 Block Mosaics Set: The BBC Master and later Acorn computers have the soft font by default defined with line drawing characters.


Amstrad

The Amstrad CPC character set also has soft characters defined by default as block and line drawing characters. The CP/M Plus character set used on various Amstrad computers of the
CPC CPC may refer to: Organizations Companies * Canada Post Corporation, the primary postal operator in Canada * Caspian Pipeline Consortium, consortium and a pipeline to transport Caspian oil to Russia's Black Sea coast * Consolidated Pastoral Co ...
, PCW and
Spectrum A spectrum (plural ''spectra'' or ''spectrums'') is a condition that is not limited to a specific set of values but can vary, without gaps, across a continuum. The word was first used scientifically in optics to describe the rainbow of color ...
families included a rich set of line-drawing characters as well:


Apple

MouseText is a set of display characters for the Apple IIc, IIe, and IIGS that includes box-drawing characters.


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. These characters were added to the Unicode standard in Version 13.


Others

Some recent embedded systems also use proprietary character sets, usually extensions to ISO 8859 character sets, which include box-drawing characters or other special symbols.


Character code

On many platforms, the character shape is determined programmatically from the character code. * ZX Spectrum block characters: *: * Amstrad CPC block characters: *: * Amstrad CPC line characters: *: * BBC Master line characters: *: * Teletext block characters: *: * DOS line draw characters are not ordered in any programmatic manner, and 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 ASCII art is a graphic design technique that uses computers for presentation and consists of pictures pieced together from the 95 printable (from a total of 128) character (computing), characters defined by the ASCII Standard from 1963 an ...
and ANSI art * MouseText


References

{{reflist, refs= Box Drawing U+2500-U+257F
The Unicode Standard Code Charts
{{cite book , title=Hewlett-Packard - Technical Reference Manual - Portable PLUS , date=August 1985 , edition=1 , id=45559-90001 , publisher= Hewlett-Packard Company, Portable Computer Division , location=Corvallis, OR, USA , url=https://archive.org/details/bitsavers_hpportableblePLUSTechnicalReferenceManualAug1985_25919880 , access-date=2016-11-27 {{cite book , title=Hewlett-Packard - Technical Reference Manual - Portable PLUS , date=December 1986 , orig-year=August 1985 , edition=2 , id=45559-90006 , publisher= Hewlett-Packard Company , location=Portable Computer Division, Corvallis, OR, USA , url=http://www.jeffcalc.hp41.eu/hpplus/files/techrefman.pdf , access-date=2016-11-27 , url-status=live , archive-url=https://web.archive.org/web/20161128194426/http://www.jeffcalc.hp41.eu/hpplus/files/techrefman.pdf , archive-date=2016-11-28 Broadcast Teletext Specification, September 1976 (a
HTML
o
scans of original document
{{cite book , title=Spectrum +3 CP/M Plus manual , chapter=Appendix II: CP/M Plus character sets / II.1 The complete character set (Language 0) , chapter-url=http://www.worldofspectrum.org/Plus3CPMManual/appendix2.html , type=User Manual , access-date=2017-07-10 , url-status=live , archive-url=https://web.archive.org/web/20091015151318/http://www.worldofspectrum.org/Plus3CPMManual/appendix2.html , archive-date=2009-10-15}

/ref> {{cite web , author-first=John C. , author-last=Elliott , date=2015-04-04 , title=Amstrad Extended BIOS Internals , work=Seasip.info , url=http://www.seasip.info/Cpm/xbiosint.html , access-date=2017-07-15 , url-status=live , archive-url=https://web.archive.org/web/20170715103636/http://www.seasip.info/Cpm/xbiosint.html , archive-date=2017-07-15 {{cite web , title=Amstrad CP/M Plus character set , url=http://fileformats.archiveteam.org/wiki/Amstrad_CP/M_Plus_character_set , access-date=2017-07-15 , url-status=live , archive-url=https://web.archive.org/web/20170715103000/http://fileformats.archiveteam.org/wiki/Amstrad_CP/M_Plus_character_set , archive-date=2017-07-15 {{cite web , title=TeleText - Het Protocol , language=nl , author=Wiels , url=https://www.wiels.nl/teletext/ , at=Mosaic characters , access-date=2017-12-21 , url-status=live , archive-url=https://web.archive.org/web/20171222002304/https://www.wiels.nl/teletext/ , archive-date=2017-12-22 Unicode
Box drawing Box Drawing is a Unicode block containing characters for compatibility with legacy graphics standards that contained characters for making bordered charts and tables, i.e. box-drawing characters. Its block name in Unicode 1.0 was Form and Chart C ...
Character sets