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

HelpMenu: non-ascii characters insert extra spaces #167

Closed
bbjubjub2494 opened this issue Feb 15, 2021 · 4 comments
Closed

HelpMenu: non-ascii characters insert extra spaces #167

bbjubjub2494 opened this issue Feb 15, 2021 · 4 comments
Assignees
Labels
area:translation I18n language translation bug Something isn't working
Milestone

Comments

@bbjubjub2494
Copy link

On the help screen, gotop typesets characters based on their byte length in UTF-8. This causes weird spacing in most languages that aren't English. This can be seen in German (lö schen, wä hrend), Esperanto (paĝ o) and upcoming French (dé but, entiè re) In Chinese this causes extra spacing between all ideographic characters. The main screen is not affected.

Termui has a Paragraph widget that can handle i18n typesetting better than the ad-hoc loop from 3 years ago. I'm working on it in b24c384. It typesets but the window is sized in such a way that it sometimes eats the last line so I need to fix that.

gotop version:

gotop v4.1.1 (Hadean)

(not fixed in master afaict)

OS/Arch:

4.19.118 GNU/Linux (NixOS)

Terminal emulator:

Sakura

Any relevant hardware info:

not applicable

tmux version:

not applicable

Also please copy or attach ~/.local/state/gotop/errors.log if it exists and contains logs: [empty]

Capture d’écran de 2021-02-15 13-29-07

@xxxserxxx
Copy link
Owner

@lourkeur outstanding report; thanks for all of the information.

@xxxserxxx xxxserxxx self-assigned this Feb 15, 2021
@xxxserxxx xxxserxxx added area:translation I18n language translation bug Something isn't working labels Feb 15, 2021
@xxxserxxx xxxserxxx added this to the v4.1.2 milestone Feb 15, 2021
@xxxserxxx
Copy link
Owner

@lourkeur Thanks for the work on this. When do you see it eating the last line?

I'm pushing my version of your changes into master; the Paragraph struct seems to work well for all languages I've tried it with. Can you see if you can reproduce the issue you were seeing with that code?

xxxserxxx added a commit that referenced this issue Feb 16, 2021
@bbjubjub2494
Copy link
Author

@xxxserxxx Your candidate is good to go as far as eating the last line goes. The textHeight calculation needed to be adjusted by 1. Your patch did, mine didn't. That's language independent as well.

@xxxserxxx
Copy link
Owner

Thanks; your code was helpful for getting it done quickly. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:translation I18n language translation bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants