-
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
pf4: Unslash tabular zeros via subset & range #18145
Conversation
The original subset and modified fonts, in otf, woff2, and base64 (in the woff2 directory): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoa @garrett that's cool.
Small question. I see in the pixel tests, even zeros without the slash changed enough to make pixel tests fail. Is that expected?
Yes, see the pixel diff @ #18125 (comment). I didn't get the hinting exactly right, as I had to recreate the inner part without the slash. It's all sub-pixel and nobody would notice except the pixel tests. After a bit of digging around: The zeros for bold in this PR are actually using bold, not semi-bold. PatternFly is using different weight numbers than I had expected. Fixing now. (They purposefully push the semibold as bold and bold as heavy... and don't use the heavy. I guess because they thought the bold was a bit too much.) |
c6864d3
to
faa442a
Compare
I've dropped the unused weights and recalibrated the weight values (as PF uses nonstandard weights to make "bold" show a medium weight instead, as the bold is pretty heavy for a UI). The adjusted weights are the screenshot was off last night. It has been fixed in the PR. |
@garrett when you slide in this screenshot https://cockpit-logs.us-east-1.linodeobjects.com/pull-18145-20230110-084945-faa442a8-fedora-36/pixeldiff.html#TestStorageBasic-testBasic-partition |
@KKoukiou: No, they're not smaller width. I made sure to preserve the widths. Perhaps tabular isn't being respected and it's dropping in the normal 0, which is a different width? That's the only explanation I can see for differing widths. It seemed to work perfectly in the first try. The pixel diff I made @ #18125 (comment) shows that my original proof of concept had the same exact widths. I did try to optimize the default one a bit more to get the filesize down... I might've messed up the metadata when optimizing. If that's the case, it's so minor that perhaps we should just standardize the 0 to the tabular width regardless. This would have the side effect of making the file size (and therefore base64 string) smaller too, since it would be just 1 glyph instead of 2. Or I could try to make sure I don't delete metadata mapping. Also, I think this is just wrong for hashes: Hashes should use probably monospace, not tabular numbers — that is, they should be fixed width and align. (And therefore, they'd have the 0 with the slash, as I didn't touch monospace.) But something like that should change outside this PR. |
The new zero width is obviously bigger than the tabular one. it's visible in most of the screenshots I am not trying to be picky, but this cancels the point of tabular - fixed width nums |
faa442a
to
6b3a103
Compare
6b3a103
to
5868919
Compare
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).
5868919
to
24a8759
Compare
Partially addresses #18125
This is the least intrusive change; fonts are embedded as to:
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.