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

Problem with emoji sizes #24

Closed
Offirmo opened this issue Jun 28, 2017 · 14 comments
Closed

Problem with emoji sizes #24

Offirmo opened this issue Jun 28, 2017 · 14 comments
Assignees

Comments

@Offirmo
Copy link

Offirmo commented Jun 28, 2017

Boxen is amazing but has troubles with emojis.

I tried to devise a PR myself, but apparently it's in a sub-sub dependency, so you'll be faster than me at fixing it:

capture d ecran 2017-06-28 a 22 31 23

I enclosed the strings with " to ensure it was not from my side.
Here is the text for reproducing:

🙂  CHARACTERISTICS 💗
"👶🏽  level.........1"
"💗  health........1"
"💙  mana..........0"
"🏋🏽  strength......1"
"🤸🏽  agility.......1"
"🏊🏽  vitality......1"
"👵🏽  wisdom........1"
"🤹🏼‍♀️  luck..........1"
@Offirmo
Copy link
Author

Offirmo commented Jun 28, 2017

I used the latest iTerm on macOs. The standard terminal app has the same problem:

capture d ecran 2017-06-28 a 22 30 43

@Offirmo
Copy link
Author

Offirmo commented Sep 21, 2017

I really need this for a pet project. I'm starting working on it. Will send PRs.

@kevva
Copy link

kevva commented Sep 21, 2017

Sounds like it's related to sindresorhus/string-width#2.

@Offirmo
Copy link
Author

Offirmo commented Sep 22, 2017

Figured it out. I'm working on is-fullwidth-code-point and string-width but that's SUPER HARD !!!

@Offirmo
Copy link
Author

Offirmo commented Sep 24, 2017

This is insanely hard, but PRs coming soon.

@Offirmo
Copy link
Author

Offirmo commented Sep 24, 2017

@Offirmo
Copy link
Author

Offirmo commented Sep 25, 2017

Progress so far:

screen shot 2017-09-25 at 10 02 05

@LinusU
Copy link

LinusU commented Sep 28, 2017

I think that the behaviour might have changed between macOS Sierra and High Sierra. I saw the same thing in one of my projects here: LinusU/emoji-commit#6

@Offirmo
Copy link
Author

Offirmo commented Oct 3, 2017

@LinusU thanks for sharing. Unicode 9 introduced full/half width emojis, that feature may have landed in High Sierra.

@Offirmo
Copy link
Author

Offirmo commented Oct 20, 2017

Sindre didn't answer to my PRs and I lost interest. Sorry guys. Maybe at a later time.

@screendriver
Copy link

@sindresorhus any updates regarding emoji support in boxen?

@sindresorhus
Copy link
Owner

This is how it looks in the latest boxen and iTerm2. Almost:

Screen Shot 2019-05-29 at 21 41 34

@Caesarovich Caesarovich self-assigned this Oct 1, 2021
@Caesarovich
Copy link
Collaborator

Sadly I think this issue should be closed without resolving. It appears that the issue is entirely related to how each terminal handles emojis (May also be an issue with the fonts used), and how to display them as characters. For example here is how it looks on

  • Windows Powershell:
    image
  • Windows CMD:
    image
  • Ubuntu (SSH -> MobaXTerm)
    image

So from the boxen point of view, the library outputs a string with exactly the number of characters needed per line and all. But the issue just depends on what the terminal makes those character appear on the screen. I regret to say that but that's nothing that can be done on boxen's side. I think the issue was brought here because boxen makes the problem more apparent, but is not causing it.

What do you say @sindresorhus ?

Sorry for the wait (2017 lol) and the deception.

@Offirmo
Copy link
Author

Offirmo commented Oct 11, 2021

Yes, it's depending on the level of unicode support from the underlying platform.

While I believe there are ways to improve boxen and string-width behavior, this will never work perfectly. I agree that the return-on-investment is not worth it.

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

Successfully merging a pull request may close this issue.

6 participants