![Mc-screenshot](https://upload.wikimedia.org/wikipedia/commons/2/2e/Mc-screenshot.png)
Box-drawing characters, also known as line-drawing characters, are a form of
semigraphics
Text-based semigraphics or pseudographics is a primitive method used in early text mode video hardware to emulate raster graphics without having to implement the logic for such a display mode.
There are two different ways to accomplish the emu ...
widely used in
text user interface
In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an ear ...
s to draw various geometric frames and boxes. Box-drawing characters typically only work well with
monospaced
A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. This contrasts with variable-width fonts, where the letters and spac ...
fonts
In metal typesetting, a font is a particular size, weight and style of a typeface. Each font is a matched set of type, with a piece (a "sort") for each glyph. A typeface consists of a range of such fonts that shared an overall design.
In mode ...
. In
graphical user interface
The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
s, these characters are much less useful as it is more simple and appropriate to draw lines and rectangles directly with graphical
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standa ...
s. However, they are still useful for
command-line interface
A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invoking executables and pro ...
s and plaintext
comments within
source code
In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the wo ...
.
Used along with box-drawing characters are
block elements
Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of th ...
, shade characters, and terminal graphic characters, these can be used for filling regions of the screen and portraying
drop shadow
In graphic design and computer graphics, a drop shadow is a visual effect consisting of a drawing element which looks like the shadow of an object, giving the impression that the object is raised above the objects behind it. The drop shadow is of ...
s.
Encodings
Unicode
Box Drawing
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology Technical standard, standard for the consistent character encoding, encoding, representation, and handling of Character (computing), text expre ...
includes 128 such characters in the
Box Drawing 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
Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of th ...
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
Symbols for Legacy Computing is a Unicode block containing graphic characters that were used for various home computers from the 1970s and 1980s and in Teletext broadcasting standards. It includes characters from the Amstrad CPC, MSX, Mattel Aqu ...
, 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 re ...
of the original IBM PC supplied the following box-drawing characters, in what
DOS
DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems.
DOS may also refer to:
Computing
* Data over signalling (DoS), multiplexing data onto a signalling channel
* Denial-of-service attack (DoS), an attack on a communicat ...
now calls
code page 437
Code page 437 (CCSID 437) is the character set of the original IBM PC (personal computer). It is also known as CP437, OEM-US, OEM 437, PC-8, or DOS Latin US. The set includes all printable ASCII characters as well as some accented letters (diacri ...
. 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
Code page 850 ( CCSID 850) (also known as CP 850, IBM 00850, OEM 850, DOS Latin 1) is a code page used under DOS and Psion's EPOC16 operating systems in Western Europe. Depending on the country setting and system configuration, code page 850 i ...
):
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 components ...
HP 110
The Hewlett-Packard HP 110 (aka HP Portable and HP 45710A) is an MS-DOS compatible portable computer released in 1984. It uses a Harris 80C86 running at 5.33 MHz with of RAM. It has an 80 character by 16 line monochrome () l ...
/
HP Portable
The Hewlett-Packard HP 110 (aka HP Portable and HP 45710A) is an MS-DOS compatible portable computer released in 1984. It uses a Harris 80C86 running at 5.33 MHz with of RAM. It has an 80 character by 16 line monochrome () l ...
and
HP 110 Plus
The Hewlett-Packard HP 110 (aka HP Portable and HP 45710A) is an MS-DOS compatible portable computer released in 1984. It uses a Harris 80C86 running at 5.33 MHz with of RAM. It has an 80 character by 16 line monochrome () l ...
/
HP Portable Plus
The Hewlett-Packard HP 110 (aka HP Portable and HP 45710A) is an MS-DOS compatible portable computer released in 1984. It uses a Harris 80C86 running at 5.33 MHz with of RAM. It has an 80 character by 16 line monochrome () l ...
, 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 ...
character set.
Unix, CP/M, BBS
On many
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
systems and early dial-up
bulletin board system
A bulletin board system (BBS), also called computer bulletin board service (CBBS), is a computer server running software that allows users to connect to the system using a terminal program. Once logged in, the user can perform functions such as ...
s the only common standard for box-drawing characters was the
VT100
The VT100 is a video terminal, introduced in August 1978 by Digital Equipment Corporation (DEC). It was one of the first terminals to support ANSI escape codes for cursor control and other tasks, and added a number of extended codes for special f ...
alternate character set (see also:
DEC Special Graphics
DEC Special Graphics is a 7-bit character set developed by Digital Equipment Corporation. This was used very often to draw box-drawing characters, boxes on the VT100 video terminal and the many emulators, and used by bulletin board software. The IS ...
). The
escape sequence
In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters.
Examples
* In C and man ...
Esc ( 0
switched the codes for lower-case ASCII letters to draw this set, and the sequence
Esc ( B
switched back:
A
Bash
Bash or BASH may refer to:
Arts and entertainment
* ''Bash!'' (Rockapella album), 1992
* ''Bash!'' (Dave Bailey album), 1961
* '' Bash: Latter-Day Plays'', a dramatic triptych
* ''BASH!'' (role-playing game), a 2005 superhero game
* "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 of ...
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
An underscore, ; also called an underline, low line, or low dash; is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on Manuscript (publishing), man ...
), =(
equal sign
The equals sign (British English, Unicode) or equal sign (American English), also known as the equality sign, is the mathematical symbol , which is used to indicate equality in some well-defined sense. In an equation, it is placed between two ...
) 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) characters defined by the ASCII Standard from 1963 and ASCII compliant chara ...
fashion.
Modern Unix
terminal emulator
A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term ''terminal'' covers all remote termin ...
s 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
Commodore may refer to:
Ranks
* Commodore (rank), a naval rank
** Commodore (Royal Navy), in the United Kingdom
** Commodore (United States)
** Commodore (Canada)
** Commodore (Finland)
** Commodore (Germany) or ''Kommodore''
* Air commodore ...
's
PETSCII
PETSCII (''PET Standard Code of Information Interchange''), also known as CBM ASCII, is the character set used in Commodore Business Machines (CBM)'s 8-bit home computers, starting with the PET from 1977 and including the C16, C64, C116, C1 ...
, include box-drawing symbols with no corresponding Unicode character.
Sinclair
The
Sinclair ZX80
The Sinclair ZX80 is a home computer launched on 29 January 1980 by Science of Cambridge Ltd. (later to be better known as Sinclair Research). It is notable for being one of the first computers available in the United Kingdom for less than a h ...
,
ZX81
The ZX81 is a home computer that was produced by Sinclair Research and manufactured in Dundee, Scotland, by Timex Corporation. It was launched in the United Kingdom in March 1981 as the successor to Sinclair's ZX80 and designed to be a low-cost ...
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 colors i ...
included a set of text semigraphics with block elements and dithering patterns in the
ZX80 character set
The ZX80 character set is the character encoding used by the Sinclair Research ZX80 microcomputer with its original 4K BASIC ROM. The encoding uses one byte per character for 256 code points. It has no relationship with previously established one ...
.
BBC and Acorn
The
BBC Micro
The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by Acorn Computers in the 1980s for the BBC Computer Literacy Project. Designed with an emphas ...
could utilize the
Teletext
A British Ceefax football index page from October 2009, showing the three-digit page numbers for a variety of football news stories
Teletext, or broadcast teletext, is a standard for displaying text and rudimentary graphics on suitably equipp ...
7-bit character set, which had 128 box-drawing characters, whose code points were shared with the regular alphanumeric and punctuation characters.
Control characters
In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than the ...
were used to switch between regular text and box drawing.
Teletext G1 Block Mosaics Set:
The
BBC Master
The BBC Master is a home computer released by Acorn Computers in early 1986. It was designed and built for the BBC, British Broadcasting Corporation (BBC) and was the successor to the BBC Micro, BBC Micro Model B. The Master 128 remained in produ ...
and later
Acorn
The acorn, or oaknut, is the nut of the oaks and their close relatives (genera ''Quercus'' and '' Lithocarpus'', in the family Fagaceae). It usually contains one seed (occasionally
two seeds), enclosed in a tough, leathery shell, and borne ...
computers have the soft font by default defined with line drawing characters.
Amstrad
The
Amstrad CPC character set The Amstrad CPC character set (alternatively known as the Locomotive BASIC, BASIC graphics character set) is the character set used in the Amstrad CPC series of 8-bit personal computers when running BASIC (the default mode, until it boots into CP/M) ...
also has soft characters defined by default as block and line drawing characters.
The
CP/M Plus character set used on various
Amstrad
Amstrad was a British electronics company, founded in 1968 by Alan Sugar at the age of 21. The name is a contraction of Alan Michael Sugar Trading. It was first listed on the London Stock Exchange in April 1980. During the late 1980s, Amstrad ...
computers of the
CPC,
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 colors i ...
families included a rich set of line-drawing characters as well:
Apple
MouseText
MouseText is a set of 32 graphical characters designed by Bruce Tognazzini and first implemented in the Apple IIc. They were then retrofitted to the Apple IIe forming part of the Enhanced IIe upgrade. A slightly revised version was then released w ...
is a set of display characters for the
Apple IIc
The Apple IIc, the fourth model in the Apple II series of personal computers, is Apple Computer's first endeavor to produce a portable computer. The result was a notebook-sized version of the Apple II that could be transported from place to pl ...
,
IIe
The Apple IIe (styled as Apple //e) is the third model in the Apple II series of personal computers produced by Apple Computer. The ''e'' in the name stands for ''enhanced'', referring to the fact that several popular features were now built-i ...
, and
IIGS
The Apple IIGS (styled as II), the fifth and most powerful of the Apple II family, is a 16-bit personal computer produced by Apple Computer. While featuring the Macintosh look and feel, and resolution and color similar to the Amiga and Atari ST ...
that includes box-drawing characters.
Teletext
The
World System Teletext
World System Teletext (WST) is the name of a standard for encoding and displaying teletext information, which is used as the standard for teletext throughout Europe today. It was adopted into the international standard ITU-R, CCIR 653 (now ITU-R BT ...
(WST) uses pixel-drawing characters for some graphics. A character cell is divided in 2×3 regions, and 2
6 = 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
ISO/IEC 8859 is a joint ISO and IEC series of standards for 8-bit character encodings. The series of standards consists of numbered parts, such as ISO/IEC 8859-1, ISO/IEC 8859-2, etc. There are 15 parts, excluding the abandoned ISO/IEC 8859-12 ...
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
In computing, a Unicode symbol is a Unicode character which is not part of a script used to write a natural language, but is nonetheless available for use as part of a text.
Many of the symbols are drawn from existing character sets or ISO/IEC or ...
*
Dingbat
In typography, a dingbat (sometimes more formally known as a printer's ornament or printer's character) is an ornament, specifically, a glyph used in typesetting, often employed to create box frames, (similar to box-drawing characters) or a ...
*
Box Drawing (Unicode Block)
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 ...
*
Block Elements (Unicode Block)
Block Elements is a Unicode block containing square block symbols of various fill and shading. Used along with block elements are box-drawing characters, shade characters, and terminal graphic characters. These can be used for filling regions of th ...
*
Geometric Shapes (Unicode Block)
Geometric Shapes is a Unicode block of 96 symbols at code point range U+25A0–25FF.
U+25A0–U+25CF
The BLACK CIRCLE is displayed when typing in a password field, in order to hide characters from a screen recorder or shoulder surfing.
U+2 ...
*
List of Unicode characters
As of Unicode version 15.0, there are 149,186 characters with code points, covering 161 modern and historical scripts, as well as multiple symbol sets. This article includes the 1062 characters in the Multilingual European Character Set 2 (ME ...
*
Text-based (computing)
In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an ear ...
*
Text semigraphics
Text-based semigraphics or pseudographics is a primitive method used in early text mode video hardware to emulate raster graphics without having to implement the logic for such a display mode.
There are two different ways to accomplish the em ...
*
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) characters defined by the ASCII Standard from 1963 and ASCII compliant chara ...
and
ANSI art
The American National Standards Institute (ANSI ) is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States. The organi ...
*
MouseText
MouseText is a set of 32 graphical characters designed by Bruce Tognazzini and first implemented in the Apple IIc. They were then retrofitted to the Apple IIe forming part of the Enhanced IIe upgrade. A slightly revised version was then released w ...
References
{{reflist, refs=
[Box Drawing U+2500-U+257F](_blank)
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
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 components ...
, 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
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 components ...
, 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
Character sets