开发者

Standards for output of programs running through a console window?

Is there a standard set for the number of rows and columns (width and height) that are displayed in a standard console window?

Does it vary by Operating Syste开发者_StackOverflowm? In windows you can resize the window vertically to allow for more rows.

Are all characters mono space and do they take up a perfect square?

I'm curious as to what the standards are for people who develop text based programs.


A standard terminal is 80 characters wide, 24 lines long. Those are the default dimensions used by terminal applications.

Edit: Its actually 25 lines, including what commonly is the command input line.

The VT100 Terminal set the de facto standard in those days. If you are really intersted have a look at this link and follow the sources: http://en.wikipedia.org/wiki/VT100

On the IBM PC the default text mode was also 80×25 characters. However, with more capable graphics adapters there appeared a whole array of other text modes that could be set or selected, such as 80×43, 80×50 or even 132×60 (cf. Wikipedia: Text mode). However, since consoles nowadays are neither physical consoles nor terminals anymore you can resize their respective windows easily on all common operating systems – deviating from above quoted sizes. If in doubt, expect anything but standard sizes (I [Joey] usually use 120×40).

As for character size: For simple scripts, such as Latin, Cyrillic, Greek, Hebrew, etc. each character occupies a single cell. Complex script support is usually hard to find in consoles, due to their heritage of ancient video terminals (and their heritage of teletypewriters). CJK ideographs usually take up two character cells, at least on Windows.


Some common configurations are:

80 x 24, 80 x 25, 100 x 25

The first one (80 x 24) is usually the most common.

Usually people opt for a monospaced vertically-rectangular font.

But there's really no way to enforce any of this.

It not only varies by OS, but by console display software and user preferences.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜