RedHatOfficial / RedHatFont

Red Hat's Open Source Fonts - Red Hat Display and Red Hat Text
SIL Open Font License 1.1
479 stars 55 forks source link

Monospace & tabular numbers: 0 incorrectly has a slash #53

Open garrett opened 1 year ago

garrett commented 1 year ago

When enabling tabular numbers with RedHatFont in PatternFly in Cockpit, we've noticed that the 0 (zero) gains a slash (/) which is not only ugly, but makes it look like an 8, especially for people who have astigmatism (including myself), making this not just a visual problem but an accessibility issue.

Tabular numbers and slashed zero are two different font variant settings. Whereas RedHatFont groups the two features under tabular-numbers.

These are both exposed in font-variant-numeric in CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric#values

font-variant-numeric takes several values; it's often just one at a time, but it can be used space-separated too. Relevant examples:

font-variant-numeric: tabular-nums;
font-variant-numeric: slashed-zero;
font-variant-numeric: tabular-nums slashed-zero;

What is asked for is the first (tabular-nums) but we're seeing effects as if we asked for tabular-nums slashed-zero.

We're tracking this @ https://github.com/cockpit-project/cockpit/issues/18125 but really need this fixed upstream here @ RedHatFont (and then need the fix included in PatternFly afterward).

garrett commented 1 year ago

Here's an example screenshot:

image

garrett commented 1 year ago

This same problem also seems to exist in "Red Hat Mono".

libbylevi commented 1 year ago

The slashed zero was a stylistic choice to differentiate zero from a capital O in the mono font, and then we decided to use the same mono numerals as the tabular numerals in the proportional fonts, for consistency across the family.

We could separate the slashed zero from the tabular number variables in the proportional fonts, but it would need to be part of an update with the typographer, and we don't have that in the plan for this year. I'll keep this in mind for next time we do an update.