I've been making a game in C++ consisting of the Unicode upper-half block (▀
U+2580) and the background, both of which can be counted as an individual pixel.
When I was testing it, I noticed that there's a small slab of color right above the ▀
, which was the same as the background color. That's when I realized that upper-half block doesn't cover the entire upper half of a character.
Note: I was using ANSI escape codes for the coloring.
int main() {
/* Will produce a black foreground character with a green background, but the top part will also have a small part of green */
std::cout << "\e[38;5;0m\e[48;5;10m▀";
return 0;
}
The ▀ character doesn’t fully cover the top half of the cell in some terminals because of how fonts render it. The small gap you see is the background showing through unused space in the glyph. This isn’t a bug in your code—just a font or terminal rendering issue. Try a different monospace font or terminal to see if it fills better.