HOME

TheInfoList



OR:

Box-drawing characters, also known as line-drawing characters, are a form of semigraphics 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. These characters are characterized by being designed to be connected horizontally and/or vertically with adjacent characters, which requires proper alignment. Box-drawing characters therefore typically only work well with
monospaced font 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 Typeface#Proportion, variable-width fonts, where t ...
s. In
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
s, these characters are much less useful as it is simpler to draw lines and rectangles directly with graphical
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
s. However, they are still useful for
command-line interface A command-line interface (CLI) is a means of interacting with software via command (computing), commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user ...
s and plaintext comments within
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
. Some recent embedded systems also use proprietary character sets, usually extensions to
ISO 8859 ISO/IEC 8859 is a joint International Organization for Standardization, ISO and International Electrotechnical Commission, IEC series of standards for 8-bit character encodings. The series of standards consists of numbered parts, such as ISO/IEC ...
character sets, which include box-drawing characters or other special symbols. Other types of 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 t ...
, 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.


Unicode


Box Drawing

Unicode Unicode or ''The Unicode Standard'' or TUS is a character encoding standard maintained by the Unicode Consortium designed to support the use of text in all of the world's writing systems that can be digitized. Version 16.0 defines 154,998 Char ...
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 List of IBM Personal Computer models, IBM PC model line and the basis for the IBM PC compatible ''de facto'' standard. Released on ...
character set (see below) will exist, due to it being defined as part of the WGL4 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 t ...
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 Aqua ...
, which includes a few box-drawing characters and other symbols used by obsolete operating systems (mostly from the 1980s). Few fonts support these characters (one is Noto Sans Symbols 2), but the table of symbols is provided here: The image below is provided as a quick reference for these symbols on systems that are unable to display them directly:


Symbols for Legacy Computing Supplement

In version 16.0 (September 2024), Unicode was extended with another block containing many graphics characters, Symbols for Legacy Computing Supplement, which includes a few box-drawing characters and other symbols used by obsolete operating systems (mostly from the 1970s and 1980s).


Platform-specific

Various different platforms defined their own unique set of box-drawing characters.


DOS

The hardware code page of the original IBM PC supplied the following box-drawing characters, in what
DOS DOS (, ) is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible syste ...
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 MS-DOS Latin US. The set includes all printable ASCII characters as well as some accented letters (di ...
. This subset of the Unicode box-drawing characters is thus included in WGL4 and is far more popular and likely to be rendered correctly: The integral halves are also box drawing as they are used alongside 0xB3: 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): 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. It was founded by Bill Hewlett and David Packard in 1939 in a one-car garage in Palo Alto, California ...
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 character set.


Unix, CP/M, BBS

On many
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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, a ...
systems and early dial-up
bulletin board system A bulletin board system (BBS), also called a computer bulletin board service (CBBS), is a computer server running list of BBS software, software that allows users to connect to the system using a terminal program. Once logged in, the user perfor ...
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 ...
alternate character set (see also: DEC Special Graphics). 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 ma ...
Esc ( 0 switched the codes for lower-case ASCII letters to draw this set, and the sequence Esc ( B switched back: 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 ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
characters that approximate box-drawing characters are used, such as - (
hyphen-minus The symbol , known in Unicode as hyphen-minus, is the form of hyphen most commonly used in digital documents. On most keyboards, it is the only character that resembles a minus sign or a dash, so it is also used for these. The name ''hyphen-mi ...
), ,  (
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 or underline 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 or typescript as an instruction to the printer. Its ...
), =(
equal sign The equals sign (British English) or equal sign (American English), also known as the equality sign, is the mathematical symbol , which is used to indicate equality. In an equation it is placed between two expressions that have the same value, ...
) and + (
plus sign The plus sign () and the minus sign () are mathematical symbols used to denote positive and negative functions, respectively. In addition, the symbol represents the operation of addition, which results in a sum, while the symbol represents ...
) 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 and ASCI ...
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 term ...
s use Unicode and thus have access to the line-drawing characters listed above.


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 ...
(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.


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 (P ...
s 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 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 Aqua ...
.


Commodore

Commodore machines, such as the
Commodore PET The Commodore PET is a line of personal computers produced starting in 1977 by Commodore International. A single all-in-one case combines a MOS Technology 6502 microprocessor, Commodore BASIC in read-only memory, keyboard, monochrome monitor ...
and the
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit computing, 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in ...
, included a set of text semigraphics with block elements and dithering patterns in the PETSCII character set.


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 hu ...
,
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-c ...
, and
ZX Spectrum The ZX Spectrum () is an 8-bit computing, 8-bit home computer developed and marketed by Sinclair Research. One of the most influential computers ever made and one of the all-time bestselling British computers, over five million units were sold. ...
included a set of text semigraphics with quadrant-based block elements. The ZX80 and ZX81 also included a set of text semigraphics with dithering patterns.


BBC and Acorn

The
BBC Micro The BBC Microcomputer System, or BBC Micro, is a family of microcomputers developed and manufactured by Acorn Computers in the early 1980s as part of the BBC's Computer Literacy Project. Launched in December 1981, it was showcased across severa ...
could utilize the
Teletext Teletext, or broadcast teletext, is a standard for displaying text and rudimentary graphics on suitably equipped television sets. Teletext sends data in the broadcast signal, hidden in the invisible vertical blanking interval area at the to ...
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 telecommunications, a control character or non-printing character (NPC) is a code point in a character set that does not represent a written character or symbol. They are used as in-band signaling to cause effects other than ...
were used to switch between regular text and box drawing. 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 prod ...
and later
Acorn The acorn is the nut (fruit), nut of the oaks and their close relatives (genera ''Quercus'', ''Notholithocarpus'' and ''Lithocarpus'', in the family Fagaceae). It usually contains a seedling surrounded by two cotyledons (seedling leaves), en ...
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 Amstrad plc was a British consumer electronics company, founded in 1968 by Alan Sugar. During the 1980s, the company was known for its Home computer, home computers beginning with the Amstrad CPC and later also the ZX Spectrum range after the ...
computers of the CPC, PCW and
Spectrum A spectrum (: spectra or spectrums) is a set of related ideas, objects, or properties whose features overlap such that they blend to form a continuum. The word ''spectrum'' was first used scientifically in optics to describe the rainbow of co ...
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 is a personal computer introduced by Apple Inc. shortly after the launch of the Macintosh 128K, original Macintosh in 1984. It is essentially a compact and portable version of the Apple IIe. The IIc has a built-in floppy disk driv ...
, 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: *: * Amstrad CPC block characters: *: * Amstrad CPC line characters: *: * BBC Master line characters: *: * Teletext block characters: *: 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

*
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 and ASCI ...
and ANSI art *
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 ...
*
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 ...
*
Text-based 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 ...
* Semigraphics * Unicode blocks **
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 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 t ...
**
Geometric Shapes A shape is a graphics, graphical representation of an object's form or its external boundary, outline, or external Surface (mathematics), surface. It is distinct from other object properties, such as color, Surface texture, texture, or material ...
**
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 Aqua ...
** Symbols for Legacy Computing Supplement


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