Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a character that will take up the full height of a line on a terminal?

I'm making a command line version of the board game Blokus and I'd like to have the pieces take up the full height of a line. I tried to use the Unicode character █ (U+2588) but it leaves vertical gaps in the lines like so:

enter image description here

Does anyone know how I can have it take up the full line?

like image 459
Drew Avatar asked Nov 18 '12 03:11

Drew


1 Answers

The U+2588 should take full height of a line in a terminal, but due to font issues, it does not always do that.

The Block Elements characters are described in clause 15.8 Geometrical symbols in the Unicode character: “the legacy block elements are designed to fill some defined fraction of each display cell or to fill each display cell with some defined degree of shading. […] When emulating terminal applications, fonts that implement the block element characters should be designed so that adjacent glyphs for characters such as U+2588 full block create solid patterns with no gaps between them.”

However, fonts that support U+2588 do not always implement it correctly. So you should check whether you can set the font to one that has a correct glyph for U+2588, such as DejaVu Sans.

If you are using U+2588 and friends in an environment that is more complicated than a simple terminal, such as software emulating a simple terminal, or in a word processor, you probably have another issue, too. Even though U+2588, when implemented correctly in a font, takes the full height of the font, it does not usually take the full height of the line. Normally line height is larger than font height (font size), and you would need to take extra measures to make them the same (to make the text “set solid”).

like image 186
Jukka K. Korpela Avatar answered Sep 23 '22 17:09

Jukka K. Korpela