You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have encountered a strange problem with reprint. I use it to build a command line utility and needed to have functionality to select a region. I used emoji flags e.g: 🇫🇷 after the region name but this resulted in the formatting of the interface screwing up. What I think is going on is the unicode system for various emojis like flags or options is comprised of 2+ symbols. In the case above, the French flag is made by combining the symbol for F with the symbol for R. See the proposal document here: https://www.unicode.org/L2/L2009/09379-n3727-regionalindicators.pdf. Reprint views this as two separate characters though and prepares it self for a line of length x. When this is rendered out to a user however, the F+R characters are combined into a single character, so a line of length x - 1. This then screws up the following lines as the initial line length calculation is wrong. This problem is apparent across all the various combination emojis that cover cases like gender and race.
Happy to assist with fixing this issue, might need some direction on where I should be looking within the project.
The text was updated successfully, but these errors were encountered:
Thanks for your detailed description!
base on your description, the issue is cause by the wrong calculation of character width, which is located in here. It's now only using the single character to calculate its width, which ignore the situation that unicode may combine two character and display them as one.
I may try to figure out a new solution to calculate line width, to cover the unicode combination situation.
Also, any contribution is absolutely welcomed, and I will follow up this issue these days.
I'm testing this issue on a Window 11 and Linux platform, seems the display width of emoji flag may diverse base on the support of display, width may be 1 or 2 columns.
the solution needs to cover these both situations.
Hello, I have encountered a strange problem with reprint. I use it to build a command line utility and needed to have functionality to select a region. I used emoji flags e.g: 🇫🇷 after the region name but this resulted in the formatting of the interface screwing up. What I think is going on is the unicode system for various emojis like flags or options is comprised of 2+ symbols. In the case above, the French flag is made by combining the symbol for F with the symbol for R. See the proposal document here: https://www.unicode.org/L2/L2009/09379-n3727-regionalindicators.pdf. Reprint views this as two separate characters though and prepares it self for a line of length x. When this is rendered out to a user however, the F+R characters are combined into a single character, so a line of length x - 1. This then screws up the following lines as the initial line length calculation is wrong. This problem is apparent across all the various combination emojis that cover cases like gender and race.
Happy to assist with fixing this issue, might need some direction on where I should be looking within the project.
The text was updated successfully, but these errors were encountered: