开源夏令营之foldcolumn工具及解决方案之box-drawing character

转自:http://en.wikipedia.org/wiki/Box-drawing_character

foldcolumn的需求中要求的是下面的Unix,CP/M,BBS方式

Box drawing characters

Box drawing characters, also known as line drawing characters, are a form of semigraphics widely used in text user interfaces to draw various frames and boxes. In graphical user interfaces, these characters are much less useful as it is much simpler to draw lines and rectangles directly with graphical APIs. Box drawing characters work only with monospaced fonts — however, they are still useful for plaintext comments on websites.
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 drop shadows.


Unicode

Unicode includes 128 such characters:In many Unicode fonts only the subset that is also available in DOS (see below) will exist, due to them being defined as part of the WGL4 character set.



DOS

The original IBM PC supplied the following box-drawing characters, in what MS-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 ditch the 18 "single/double hybrid" characters to use their places for other, usually alphabetic, characters (such as code page 850):


Note: The non-double characters are the "thin" ones (U+2500, U+2502), not the "fat" ones (U+2501, U+2503)

Unix, CP/M, BBS

On many Unix systems, and on early dial-up bulletin board systems the only common standard for box-drawing characters was the VT100 alternate character set. The sequence "<Esc>(0" switched the codes for lower-case ASCII letters to draw this set, and "<Esc>(B" switched back:


Bash script using display of all semigraphic characters:
         char=( 6a 6b 6c 6d 6e 71 74 75 76 77 78 )
         for i in ${char[*]}; do printf "0x$i \x$i \e(0\x$i\e(B\n"; done
And on some terminals, they are not available at all, and the complexity of the escape sequences discouraged their use, so often only ASCII characters that approximate box drawing characters are used, such as - (hyphen-minus), | (vertical bar), _ (underscore), = (equal sign) and + (plus sign) in a kind of ASCII art fashion.
Modern Unix terminal emulators use Unicode and thus have access to the line drawing characters listed above.

Historical

Many microcomputers 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.
The Sinclair ZX81 and Spectrum included a set of text semigraphics with block elements and dithering patterns.
The BBC Micro could utilise 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.
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.
The World Standard 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”. However, these characters have not been encoded into the Unicode standard.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值