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

material-nf: net block is printed in reverse order when loopback device is used #1206

Closed
MaxVerevkin opened this issue May 3, 2021 · 16 comments · Fixed by #1280
Closed

material-nf: net block is printed in reverse order when loopback device is used #1206

MaxVerevkin opened this issue May 3, 2021 · 16 comments · Fixed by #1280

Comments

@MaxVerevkin
Copy link
Collaborator

Output in the terminal seems OK.

Config

icons = "material-nf"

[[block]]
block = "net"
format = "{signal_strength} {graph_down}{speed_down;K}{speed_up;K}"
interval = 1

Video

for-gh.mp4
@ammgws
Copy link
Collaborator

ammgws commented Jun 12, 2021

Did you ever figure out what was going on here?

@MaxVerevkin
Copy link
Collaborator Author

Did you ever figure out what was going on here?

No, it's still happening.

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

Also happens with the pacman block when using icons = material-nf. If using format = "{pacman} + {aur}" and there are 2 pacman update available, 0 + 2 is printed.

@MaxVerevkin
Copy link
Collaborator Author

Also happens with the pacman block when using icons = material-nf. If using format = "{pacman} + {aur}" and there are 2 pacman update available, 0 + 2 is printed.

Terminal output is correct, right?

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

So one updatable pkg prints 1 - two pkgs print 0 + 2.
Terminal output is correct, but if I copy & paste it, it's reversed again - wtf? {"full_text":" ﮮ 2 + 0 ","color":"#002b36","background":"#268bd2","name":"9","instance":"0","separator":false,"separator_block_width":0,"markup":"pango"} <- The string after "full_text" is in reverse - it was in the correct order in the terminal.

@ammgws
Copy link
Collaborator

ammgws commented Jul 20, 2021

Is it backwards no matter what software you paste it into?

Also, try searching on the nerdfonts bug tracker as well because surely others have come across this too

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

The issue is the glyph 0xfbae. The string is not reversed when it's missing.
@ammgws It's reversed in the browser and the bar but neither in the terminal nor in the editor.

@GladOSkar
Copy link
Contributor

I'mma hazard a wild guess and say that's because 0xfbae is an Arabic letter in UTF-16, which results some text renderers to presume arabic text flow, i.e. RTL

@GladOSkar
Copy link
Contributor

GladOSkar commented Jul 20, 2021

Especially because apparently when @freswa pasted it into their browser it resulted in which is that exact character, although i have no idea why/how a UTF-8 byte sequence could be interpreted as UTF-16 when rendering/pasting

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

Loopback is 0xfbe9 - same problem.

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

I think adding a 0x200e at the end should do the trick: " ﮮ 2 + 0 ‎"
Any other ideas to force pange/harfbuzz to print this LTR?

@freswa
Copy link
Contributor

freswa commented Jul 20, 2021

Apparently there is an issue that the glyphs are not PUA conform: ryanoasis/nerd-fonts#365

@freswa
Copy link
Contributor

freswa commented Jul 21, 2021

I think adding a 0x200e at the end should do the trick: " ﮮ 2 + 0 ‎"
Any other ideas to force pange/harfbuzz to print this LTR?

Garbage. The LTR marker needs to be right behind the "arabic" glyph, like " ﮮ‎ 2 + 0 ‎". Works here in github, but not for us:
screen-2021-07-21_1626862725

@MaxVerevkin Can you try setting net_loopback = "\ufbe9\u200e" # nf-mdi-loop in your material-nf.toml?

freswa pushed a commit to freswa/i3status-rust that referenced this issue Jul 21, 2021
NerdFonts has one big issue. They overwrite code points which are
reserved for chinese and arabic letters (range 0xf500-0xfd46).
While overwriting chinese letters is bad, they are LTR glyphs and print
"normally".
`net_loopback` and `update` used to be symbols that usually map
to arabic letters which make pango print those strings RTL. I
tried to fix this with the LTR marker 0x200e in greshake#1206 but it failed.
This PR replaces the symbols with similar ones that don't map to
the arabic charset.
nerd-font issue: ryanoasis/nerd-fonts#365
fixes greshake#1206
@MaxVerevkin
Copy link
Collaborator Author

MaxVerevkin commented Jul 21, 2021

@MaxVerevkin Can you try setting net_loopback = "\ufbe9\u200e" # nf-mdi-loop in your material-nf.toml?

No, it doesn't fix everything. However, if if prepend it with any ASCII text, it works...

While

net_loopback = "\ufbe9\u200e" # nf-mdi-loop

Shows
image

net_loopback = "a\ufbe9\u200e" # nf-mdi-loop

Shows
image

@GladOSkar
Copy link
Contributor

What happens if you prepend it with a zero-width space?

@MaxVerevkin
Copy link
Collaborator Author

No effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants