Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background color of Unicode characters not displayed completely #337

Open
mark-wehrmann opened this issue Mar 23, 2022 · 1 comment
Open

Comments

@mark-wehrmann
Copy link

import colorama

colorama.init()
print("\N{WHITE CHESS KNIGHT}")
print("\N{WHITE CHESS ROOk}")
print(colorama.Back.YELLOW + "\N{WHITE CHESS KNIGHT}" + colorama.Back.RESET)
print(colorama.Back.RED + "\N{WHITE CHESS ROOK}" + colorama.Back.RESET)

This give following output:
image

As you can see the background color of the Chess figures is only displayed up to half of the actual character.

Is there a workaround available?

@shaperilio
Copy link

Just FYI, it seems a lot of fonts don't respect / don't properly define the width of some / all unicode characters. Try printing several knights / rooks on the same line, they're probably going to be on top of each other.

For example, in Windows 10 with PowerShell 7.3.6, I don't even get the characters - but the width is correct:
image

In whatever font VSCode uses, I get the same as you:
image

If I add a space after the characters in question, the background "fills in":

import colorama

colorama.init()
print("\N{WHITE CHESS KNIGHT}")
print("\N{WHITE CHESS ROOK}")
print(colorama.Back.YELLOW + "\N{WHITE CHESS KNIGHT} " + colorama.Back.RESET)
print(colorama.Back.RED + "\N{WHITE CHESS ROOK} " + colorama.Back.RESET)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants