-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Carefully opt into tabular fonts instead of using them everywhere #18125
Comments
Big +1. IMHO this looks super-ugly right now, as the monospaced text is being used overzealously everywhere. We have wild font inconsistencies like this now: Notice how we format zeros differently in the Configuration card, and how ugly the dates are. Monospaced numbers only make sense in some tabular environments where they actually need to be aligned. The only place where this is the case on the overview page is here: But ironically it doesn't even help fully, as the progress bars still have different lengths. It does help to not make the memory bar "jumpy" if the used amount changes a little, though. I went through all the pages, and the only other potential usages of tabular numbers that I found are on hwinfo: (Although it's not really necessary there) and to ensure properly aligned timestamps on the Networking page's Log view: But in all of these cases we'd actually be better off with using a proper monospace font. In other words: These need to be opt-in and carefully/explicitly used, instead of "everywhere". They are called tabular for a reason? Also, I find these zeros super ugly, at first I thought my system was broken and somehow missed proper fonts -- but that's a matter of taste. But more objectively, paragraph text or most text which doesn't rely on alignment should use proportional fonts. |
The 0 with a slash is a bug in the font; it should have variants with and without the slash, and it should be controlled by a font feature (which is exposed in CSS). Tabular numbers are needed for columns in tables that have numbers and anywhere where numbers are compared, including numbers compared with themselves over time (such as progress bars and sliders) and numbers compared with other numbers (which is why I mentioned columns in tables). It's also useful for things like IP addresses. Tabular numbers are not needed for a mix of alphanumeric instead of just numeric where it's not being compared or changing over time. So we really have 3 issues:
|
No, that's another bug. It's properly solved with And this is only a problem with usage bars. For progress bars, it's actually still an issue elsewhere. |
We also need to report this upstream to both PatternFly and RedHatFont. |
RedHatMono also seems to have the slash. I guess this also needs a patch. And I guess this means I'll have to do type "surgery" in FontForge again with a subset for a hotfix. 😞 (And for the various variants as well, such as bold and possibly italic if there's a mono form.)
|
Partially addresses cockpit-project#18125 This is the least intrusive change; fonts are embedded as to: - Not require buildsystem changes to ship font files - Not inflate number of connections from browser to Cockpit - Be easily portable to cockpit-machines, cockpit-podman, etc. It's messy when viewing the stylesheet, so they're at the bottom of the file. Additionally, subsetting and mapping these custom versions of the fonts are much smaller in size than forking the font and using our own custom version, which would be worse. Note: PatternFly, and therefore Cockpit, uses non-standard weights so medium (semi-bold) becomes bold. Additionally, only regular and medium weights are used, so we're only including these two weights and their italic variants in the override. (Leaving out light, bold, and heavy weights and their italic variants).
Partially addresses #18125 This is the least intrusive change; fonts are embedded as to: - Not require buildsystem changes to ship font files - Not inflate number of connections from browser to Cockpit - Be easily portable to cockpit-machines, cockpit-podman, etc. It's messy when viewing the stylesheet, so they're at the bottom of the file. Additionally, subsetting and mapping these custom versions of the fonts are much smaller in size than forking the font and using our own custom version, which would be worse. Note: PatternFly, and therefore Cockpit, uses non-standard weights so medium (semi-bold) becomes bold. Additionally, only regular and medium weights are used, so we're only including these two weights and their italic variants in the override. (Leaving out light, bold, and heavy weights and their italic variants).
We now insert this class on the top of all page, thus making anything numeric (there are exceptions ?!) use tabular fonts. We should rather focus on adding this only to elements that need this. For example sliders values.
patternfly/patternfly-design#1140
The text was updated successfully, but these errors were encountered: