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

Tables with some emojis are printed with uneven layout #252

Closed
sumiya11 opened this issue Nov 21, 2024 · 3 comments
Closed

Tables with some emojis are printed with uneven layout #252

sumiya11 opened this issue Nov 21, 2024 · 3 comments

Comments

@sumiya11
Copy link

For example, see the screenshot:

image
@ronisbr
Copy link
Owner

ronisbr commented Nov 26, 2024

Hi @sumiya11 !

That's probably the UTF-8 support in your terminal / font. We rely on the function textwidth to compute how many display characters an UTF-8 character use to be rendered. This function seems to work well for many cases. However, if your terminal does not use the correct width during the rendering, it will be off and there is nothing we can do about it :(

Notice that the missing space for the correct alignment does not seem to be an entire character. Hence, I really think that the problem is the rendering process of your terminal + font.

This problem will occur even if you print this character on your terminal even outside Julia. Hence, unfortunately there is nothing we can do from PrettyTables.jl side :(

@ronisbr ronisbr closed this as completed Nov 26, 2024
@sumiya11
Copy link
Author

Thanks for the answer! I see.

Notes:

>>> "{:<10}|".format("hi ☺️  ")
'hi ☺️     |'
>>> "{:<10}|".format("hi 👿  ")
'hi 👿      |'

@ronisbr
Copy link
Owner

ronisbr commented Nov 26, 2024

Yes... some of the emojis are not handled correctly unfortunately. This problem also happens to the flags in most of the cases.

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