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

Separator \ue0b2 vertical alignement and size again #1865

Open
tkapias opened this issue Apr 14, 2023 · 4 comments
Open

Separator \ue0b2 vertical alignement and size again #1865

tkapias opened this issue Apr 14, 2023 · 4 comments
Labels
docs Documentation errors, updates, or omissions. fonts/spacing/rendering

Comments

@tkapias
Copy link

tkapias commented Apr 14, 2023

There where many issues with the separator character \ue0b2 (), like #246. They are all unsolved.

I just wanted to let people know that I found one easy solution. Not i3 patching and perfect alignement.

First let me tell you that I tried, Nerd fonts, Powerline fonts, Awesome fonts, different pango parameters and sizes. Nothing worked.

Found the solutoion here : https://grapefruit.neocities.org/hacks/i3blocks_powerline

My i3wm config for bar:

bar {
    id bar-1
    status_command i3status-rs ~/.config/i3status-rust/config.toml
    i3bar_command i3bar --transparency
    font pango:IBM Plex Mono, Material Icons 12
    position bottom
    tray_output primary
    mode hide
    hidden_state hide
    modifier $mod
    workspace_min_width 40
    colors {
        separator #282a36
        background #282a3670
        statusline #f8f8f2
        focused_workspace #50fa7b70 #50fa7b #282a36
        active_workspace #8be9fd70 #8be9fd #282a36
        inactive_workspace #282a3670 #282a3670 #f8f8f2
        urgent_workspace #2f343a70 #ff555570 #282a36
    }
    padding 0
}

My i3stats-rust theme config:

[theme]
theme = "dracula"
[theme.overrides]
idle_bg = "#22222270"
separator = "<span font-family='Terminus' size='16000'></span>"

[icons]
icons = "material"

Using Terminus font in the i3wm bar config as a fallback did not work. Only using it in the span did the trick for me.

Please test on other hardware and add to doc if it's good.

@GladOSkar
Copy link
Contributor

GladOSkar commented Apr 15, 2023

I believe i tried this back then, but the pango size property only affected the size of the character, but its base line stayed the same and didn't move down all the way (Edit: See this comment, although i used pangos font option instead of size there, that might be the difference), hence the patching of i3bar. But if this works for you, great! If there's anything we've learned here it's that pixel perfect font rendering depends on way more factors than one may think

@tkapias
Copy link
Author

tkapias commented Apr 15, 2023

It's probably because the Terminus font is doing something better than other fonts with this character a least.

i3status-rust is not the only software with this kind of scaling issue. It's a big deal for URxvt for example and you need to try many fonts or convert them first. It always made me think that there is something wrong with a lot of mono fonts intended for console but not really designed for compatibility.

I would like more people to confirm the difference and this topic could be closed.

@GladOSkar
Copy link
Contributor

GladOSkar commented Apr 16, 2023

I mean the characters are basically higher than the area they are supposed to be in, kind of makes sense that it runs into lots of edge cases.

I just tried <span size='16000'></span> instead of <span font='15'></span> in my config and it's definitely better, i got the last pixel of border to go away (since switching to sway i don't use the i3 patch anymore).

I think adding this as a note to the theming docs would be a good idea.

@MaxVerevkin MaxVerevkin added fonts/spacing/rendering docs Documentation errors, updates, or omissions. labels Apr 17, 2023
@tkapias
Copy link
Author

tkapias commented Apr 17, 2023

After this thread I upgraded my Nerd-Fonts to fixes some issues with my terminal, and because I saw that there was a big update.
They They moved the codepoints for Material Design Icons (old codepoints are obsolete and will be deleted soon) and fixed all the Material Design Icons scaling issues.

I patched my own font and it fixed all the scaling in the terminal for me and I use it for i3status-rust too now, no need for terminus, but still a need to change the size of the powerline character:

image

  • Example generation of patched NErd-Fonts font:
./font-patcher --use-single-width-glyphs --adjust-line-height --complete --careful --removeligatures --extension ttf --outputdir ../NerdFonts/ --glyphdir src/glyphs/ --progressbars --makegroups --xavgcharwidth 1000 ../Fonts/IBMPlexMono-Regular.ttf
  • In the i3 conf:
font pango:BlexMono Nerd Font Mono Regular, BlexMono Nerd Font Mono Bold, 10
  • In the i3status-rust conf:
[theme.overrides]
separator = "<span size='12500'></span>"

[icons]
icons = "material-nf"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation errors, updates, or omissions. fonts/spacing/rendering
Projects
None yet
Development

No branches or pull requests

3 participants