Skip to content

Emojis don't affect the width of columns #32

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

Closed
sacooke opened this issue Feb 27, 2022 · 3 comments
Closed

Emojis don't affect the width of columns #32

sacooke opened this issue Feb 27, 2022 · 3 comments

Comments

@sacooke
Copy link

sacooke commented Feb 27, 2022

If a unicode emoji is part of the longest text in a column, the width of the column will not account for its existence.

Example:
outputBoss = t2a( header=["","Crocodile 🐊"], body=[["HP","100/100"], ["Atk","10"], ["Def","8"]], first_col_heading=True )

Output: https://i.imgur.com/kacEMc6.png

@sacooke
Copy link
Author

sacooke commented Feb 27, 2022

Actually, the issue might be that the emoji is actually being factored into the width, but it's only being treated as the same width as a non-emoji character. Now that I think about it, this issue might be unresolvable.

@DenverCoder1
Copy link
Owner

The emojis are being rendered with a font that is not monospace, meaning the characters do not take up the same width as other characters.

Unfortunately, there is no possible fix for this since you can't know how much space is necessary to align characters with variable widths.

@DenverCoder1
Copy link
Owner

#63 is also a fix for this issue when displaying the table at least with some fonts (where emojis take up exactly twice the width of regular characters)

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