Javascript required
Skip to content Skip to sidebar Skip to footer

Draw a Box Using Ascii Characters

Unicode block group

Box-cartoon characters, also known as line-drawing characters, are a form of semigraphics widely used in text user interfaces to draw diverse geometric frames and boxes. Box-drawing characters typically only piece of 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 notwithstanding useful for command-line interfaces and plaintext comments within source lawmaking.

Used forth with box-drawing characters are cake elements, shade characters, and final graphic characters. These can be used for filling regions of the screen and portraying drop shadows.

Encodings [edit]

Unicode [edit]

Box Drawing [edit]

Unicode includes 128 such characters in the Box Drawing block.[i] In many Unicode fonts merely the subset that is also available in the IBM PC grapheme set (see below) will exist, due to it being divers as part of the WGL4 character set.

Box Drawing [i]
Official Unicode Consortium code chart (PDF)
0 1 ii 3 iv 5 half-dozen 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
ane. ^ Equally of Unicode version 14.0

The prototype beneath is provided as a quick reference for these symbols on systems that are unable to display them directly:

Unicode Box Drawings (2500 - 27FF).svg

Block Elements [edit]

The Block Elements Unicode cake includes shading characters. 32 characters are included in the block.

Block Elements [1]
Official Unicode Consortium lawmaking chart (PDF)
0 1 2 3 4 five 6 seven 8 9 A B C D E F
U+258x
U+259x
Notes
ane. ^ Every bit of Unicode version 14.0

Symbols for Legacy Computing [edit]

In version thirteen.0, Unicode was extended with another cake containing many graphics characters, Symbols for Legacy Computing, which includes a few box-drawing characters and other symbols used past obsolete operating systems (mostly from the 1980s):

Symbols for Legacy Computing [1] [2]
Official Unicode Consortium code chart (PDF)
0 1 2 3 4 5 vi 7 8 nine A B C D East 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
1. ^ As of Unicode version fourteen.0
two. ^ Grayness areas indicate not-assigned code points

The epitome below is provided as a quick reference for these symbols on systems that are unable to display them direct:

Symbols for Legacy Computing Unicode block.png

DOS [edit]

The hardware code page of the original IBM PC supplied the following box-drawing characters, in what DOS at present calls code page 437. This subset of the Unicode box-cartoon characters is thus far more popular and likely to be rendered correctly:

0 1 2 3 4 5 6 7 8 nine A B C D E F
B
C
D

Their number is further express to 22 on those code pages that supersede the 18 characters that combine single and double lines with other, usually alphabetic, characters (such every bit code page 850):

0 one two iii 4 5 6 7 eight ix A B C D E F
B
C
D

Annotation: 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 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 grapheme set.[ii] [3]

[2] [three] 0 one two 3 four 5 6 7 8 ix A B C D E F
8
nine

Unix, CP/Grand, BBS [edit]

On many Unix systems and early on dial-up bulletin board systems the only common standard for box-cartoon characters was the VT100 alternating graphic symbol gear up (come across also: DEC Special Graphics). The escape sequence Esc ( 0 switched the codes for lower-example ASCII letters to draw this set, and the sequence Esc ( B switched back:

0 1 2 3 4 5 6 seven 8 nine A B C D East F
six
7

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\10            $i            \x1b(B\northward"            ;            washed            0x6a j ┘            0x6b grand ┐            0x6c l ┌            0x6d m └            0x6e northward ┼            0x71 q ─            0x74 t ├            0x75 u ┤            0x76 v ┴            0x77 w ┬            0x78 x │          

On some terminals, these characters are non bachelor at all, and the complexity of the escape sequences discouraged their use, so often but ASCII characters that judge box-cartoon characters are used, such as - (hyphen-minus), | (vertical bar), _(underscore), =(equal sign) and + (plus sign) in a kind of ASCII art manner.

Modern Unix terminal emulators utilise Unicode and thus have admission to the line-drawing characters listed to a higher place.

Historical [edit]

Many microcomputers of the 1970s and 1980s had their own proprietary character sets, which too included box-drawing characters. Some of these sets, such equally Commodore's PETSCII, include box-drawing symbols with no corresponding Unicode character.

Sinclair [edit]

The Sinclair ZX80, ZX81 and Spectrum included a gear up of text semigraphics with block elements and dithering patterns in the ZX80 character gear up.

ZX81 semigraphics

BBC and Acorn [edit]

The BBC Micro could utilize the Teletext 7-fleck grapheme 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.[4]

Teletext G1 Cake Mosaics Set:[five]

0 1 2 3 four 5 6 7 8 nine A B C D E F
2 NBSP TRS-80 character 0x81.png TRS-80 character 0x82.png TRS-80 character 0x83.png TRS-80 character 0x84.png TRS-80 character 0x85.png TRS-80 character 0x86.png TRS-80 character 0x87.png TRS-80 character 0x88.png TRS-80 character 0x89.png TRS-80 character 0x8A.png TRS-80 character 0x8B.png TRS-80 character 0x8C.png TRS-80 character 0x8D.png TRS-80 character 0x8E.png TRS-80 character 0x8F.png
iii TRS-80 character 0x90.png TRS-80 character 0x91.png TRS-80 character 0x92.png TRS-80 character 0x93.png TRS-80 character 0x94.png TRS-80 character 0x95.png TRS-80 character 0x96.png TRS-80 character 0x97.png TRS-80 character 0x98.png TRS-80 character 0x99.png TRS-80 character 0x9A.png TRS-80 character 0x9B.png TRS-80 character 0x9C.png TRS-80 character 0x9D.png TRS-80 character 0x9E.png TRS-80 character 0x9F.png
6 TRS-80 character 0xA0.png TRS-80 character 0xA1.png TRS-80 character 0xA2.png TRS-80 character 0xA3.png TRS-80 character 0xA4.png TRS-80 character 0xA5.png TRS-80 character 0xA6.png TRS-80 character 0xA7.png TRS-80 character 0xA8.png TRS-80 character 0xA9.png TRS-80 character 0xAA.png TRS-80 character 0xAB.png TRS-80 character 0xAC.png TRS-80 character 0xAD.png TRS-80 character 0xAE.png TRS-80 character 0xAF.png
7 TRS-80 character 0xB0.png TRS-80 character 0xB1.png TRS-80 character 0xB2.png TRS-80 character 0xB3.png TRS-80 character 0xB4.png TRS-80 character 0xB5.png TRS-80 character 0xB6.png TRS-80 character 0xB7.png TRS-80 character 0xB8.png TRS-80 character 0xB9.png TRS-80 character 0xBA.png TRS-80 character 0xBB.png TRS-80 character 0xBC.png TRS-80 character 0xBD.png TRS-80 character 0xBE.png TRS-80 character 0xBF.png

The BBC Master and later on Acorn computers take the soft font past default divers with line cartoon characters.

0 1 2 iii 4 5 6 7 8 nine A B C D E F
A
B

Amstrad [edit]

The Amstrad CPC graphic symbol set up also has soft characters defined past default as cake and line drawing characters.

0 1 ii 3 4 5 6 7 viii nine A B C D E F
viii
9

The CP/Thousand Plus grapheme fix used on diverse Amstrad computers of the CPC, PCW and Spectrum families included a rich set of line-cartoon characters every bit well:[half-dozen] [7] [eight]

[6] 0 1 two three 4 five 6 vii 8 9 A B C D East F
viii
ix

Apple [edit]

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

Teletext [edit]

The World System Teletext (WST) uses pixel-drawing characters for some graphics. A graphic symbol cell is divided in 2×3 regions, and 26 = 64 lawmaking positions are allocated for all possible combinations of pixels.[nine] These characters were added to the Unicode standard in Version thirteen.[x]

Others [edit]

Some recent embedded systems also employ proprietary graphic symbol sets, ordinarily extensions to ISO 8859 graphic symbol sets, which include box-drawing characters or other special symbols.

Grapheme lawmaking [edit]

On many platforms, the grapheme 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*ane + topright*2 + bottomleft*iv + bottomright*8
  • Amstrad CPC line characters:
    0x90 + upwards*one + correct*2 + down*4 + left*8
  • BBC Master line characters:
    0xA0 + down*one + right*2 + left*4 + up*8
  • Teletext block characters:
    0xA0 + topleft*1 + topright*2 + middleleft*4 + middleright*eight + bottomleft*sixteen + bottomright*64
  • DOS line draw characters are not ordered in any programmatic fashion, and calculating a particular character shape needs to use a expect-up table.

Examples [edit]

Sample diagrams made out of the standard box-cartoon characters, using a monospaced font:

┌─┬┐  ╔═╦╗  ╓─╥╖  ╒═╤╕ │ ││  ║ ║║  ║ ║║  │ ││ ├─┼┤  ╠═╬╣  ╟─╫╢  ╞═╪╡ └─┴┘  ╚═╩╝  ╙─╨╜  ╘═╧╛ ┌───────────────────┐ │  ╔═══╗ Some Text  │▒ │  ╚═╦═╝ in the box │▒ ╞═╤══╩══╤═══════════╡▒ │ ├──┬──┤           │▒ │ └──┴──┘           │▒ └───────────────────┘▒  ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒        

See also [edit]

  • Unicode symbols
  • Dingbat
  • Box Drawing (Unicode Block)
  • Cake Elements (Unicode Block)
  • Geometric Shapes (Unicode Block)
  • List of Unicode characters
  • Text-based (computing)
  • Text semigraphics
  • ASCII art and ANSI art
  • MouseText

References [edit]

  1. ^ Box Drawing U+2500-U+257F, The Unicode Standard Lawmaking Charts
  2. ^ a b Hewlett-Packard - Technical Reference Manual - Portable PLUS (1 ed.). Corvallis, OR, Us: Hewlett-Packard Company, Portable Computer Division. Baronial 1985. 45559-90001. Retrieved 2016-xi-27 .
  3. ^ a b Hewlett-Packard - Technical Reference Manual - Portable PLUS (PDF) (2 ed.). Portable Reckoner Division, Corvallis, OR, USA: Hewlett-Packard Company. December 1986 [August 1985]. 45559-90006. Archived (PDF) from the original on 2016-eleven-28. Retrieved 2016-11-27 .
  4. ^ Broadcast Teletext Specification, September 1976 (as HTML or scans of original certificate)
  5. ^ https://www.etsi.org/deliver/etsi_i_ets/300700_300799/300706/01_60/ets_300706e01p.pdf#page=126[ bare URL PDF ]
  6. ^ a b "Appendix Two: CP/M Plus grapheme sets / II.one The complete character fix (Language 0)". Spectrum +3 CP/Grand Plus transmission (User Manual). Archived from the original on 2009-10-15. Retrieved 2017-07-10 . [i]
  7. ^ Elliott, John C. (2015-04-04). "Amstrad Extended BIOS Internals". Seasip.info. Archived from the original on 2017-07-fifteen. Retrieved 2017-07-fifteen .
  8. ^ "Amstrad CP/M Plus character set". Archived from the original on 2017-07-xv. Retrieved 2017-07-15 .
  9. ^ Wiels. "TeleText - Het Protocol" (in Dutch). Mosaic characters. Archived from the original on 2017-12-22. Retrieved 2017-12-21 .
  10. ^ "Symbols for Legacy Computing" (PDF). Unicode Consortium . Retrieved 2020-04-19 .

mackiebutheas.blogspot.com

Source: https://en.wikipedia.org/wiki/Box-drawing_character