Closed enebo closed 1 year ago
Thank you for reporting this issue.
Do you use a monospaced font? When using a monospaced font, the text should not shift left and right because each character has the same width. If you use a non-monospaced font, the width of different characters is not fixed, which can cause the text to shift.
For example, when I use the Ubuntu Mono
font, the displayed width remains constant regardless of the usage rate or internet speed.
In fact, when formatting text, this extension uses padStart()
to pad values (i.e. the %4d you mentioned). See lines 267 and 275 of the code.
If you are using a monospaced font and experiencing character shifting, please tell me more details as it will be helpful for me.
@LGiki lol. sorry I did not get your comment auto-appended to this tab so once I realized what I was seeing with padding I changed the title and description.
I feel like there may be a special case for 0 for up and down bytes which is not padded? Otherwise the left space padding is fine. I am on a fresh FC install and it appears to be monospaced.
amount.toFixed(digits).toString().padStart(4)
Is there ever a case where the string wiht padStart(4) will just return itself? When I see 0 B/s | 0 B/s
there is no padding for those two. It is difficult to try and screenshot because it only happens occasionally and only for a very short time.
Ok for whatever reason it defaulted to sans 14. This is pretty amazing because it truly looked monospaced but I suppose most of the numbers are. Sorry for the noise.
Not sure how the default is chosen though? It is a brand new install and that shows sans 14 in your config menu. I guess that comes from some other location by default?
The default Sans 14
font comes from src/schemas/org.gnome.shell.extensions.simple-system-monitor.gschema.xml
Due to the fact that the monospaced fonts installed on different computers vary, I am unable to make a pre-selection for users. Therefore, the choice of font is left to the user. Therefore, I set the default font to Sans 14
.
In addition, I can actually set the font to monospace
, which in CSS represents a fixed-width font (the gnome extension uses CSS to control its style). But most distros' default monospace font looks ugly, just like the image below. Therefore, I decided to set it to Sans 14
and remind users to use a monospaced font in the extension's page and settings window.
@LGiki thanks for the explanation. Fonts are subjective and supporting multiple distros is no doubt hard so I understand.
I had not noticed but this extension does whitespace pad (my original report assumed it wasn't). When up or down are 0 the padding disappears and all the text to the left shifts over while it is 0 but then is padded regularly again once it is >0.