paoloose / urn

Split tracker / timer with GTK+ frontend. *nix alternative to LiveSplit. This is teh urn.
GNU General Public License v3.0
49 stars 4 forks source link

Timer font should be monospace to avoid time jittering around. #4

Closed Shadetheartist closed 1 year ago

Shadetheartist commented 1 year ago

When the time font is not monospaced the differences in character widths cause the time text to jitter around, using monospace or possibly aligning the text left or center would also fix this issue.

paoloose commented 1 year ago

Sadly the available CSS properties for gtk3 don't support alignment, making it impossible to customize this using a theme, AFAIK. You can make that a separate issue to see if someone can help with this, if you want to.

Currently, the font-family for the .timer class is not defined on urn-gtk.css, so the system default font will be used. In most cases, it should fallback to DejaVu Sans, which works great, and shouldn't cause jittering for numbers. Have you experienced any issues with this font, or are you referring to the idea of supporting non-monospace font types?

Shadetheartist commented 1 year ago

Oh that's weird, i had no problem modifying the css file to use a monospace. I jjust added font-family: monospace; to .timer With the default font it was not monospace and i was experiencing jitter.

image

paoloose commented 1 year ago

Oh that's weird, i had no problem modifying the css file to use a monospace

Yeah, I was referring to the fact that horizontal alignment (left-center-right), is not supported on CSS for gtk3, that sucks

With the default font it was not monospace and i was experiencing jitter.

Thanks for pointing this out. It's not convenient to rely on the default system font, a font-family should be defined, at least for the timer that is vulnerable to jittering. Was DejaVu Sans the default font that you mention?

Shadetheartist commented 1 year ago

I'm using gnome and my default fonts are: image

paoloose commented 1 year ago

Thanks! So I set DejaVu Sans -> monospace as default font for the timer, it works great. Also I document it as an optional dependency. I think that solves this issue for now.