Contrast, APCA, Answers, Questions, and Comments #567
Myndex
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ASSESSING FONT WEIGHT & SIZE
Answering a user's question at the APCA Repo:
YES!
Use any reasonable font you would like. Yes, the lack of standardization is definitely a problem. But how serious a problem? It causes less of a bump than you may think, and there is a simple way to find equivalence.
The biggest problem relates to the kind of fonts that are needed for blocks of body text to be fluently readable, meaning best speed and comprehension. For the kinds of fonts someone would reasonably use, the variation is not as substantial as, say, for display fonts.
At present the WCAG 3 guidance states (emphasis added):
FROM WCAG 3.0 WORKING DRAFT
The following table cross indexes APCA contrast values to the reference font's CSS font-size and CSS font-weight. Reference fonts for comparison include Helvetica Neue, Helvetica, Fira Sans, Kanit, and Arial. Contrast percentage must meet or exceed the value listed, using the absolute value for negative values. A ⊘ indicates that a larger font size (or heavier font weight) must be used.
• Due to the vast variety of font designs, designers should visually compare an unusual font to a standard font such as Helvetica, using the size and weight of Helvetica that most closely matches the appearance of the tested font as a guide.
-webkit-font-smoothing: antialiasing
is strongly discouraged.Compare to be Fair
So at the moment, take your desired font and compare to the references fonts "Helvetica Neue, Helvetica, Fira Sans, Kanit, and Arial."
Check the x-height, and visually compare the relative weight.
Let's use a 400 normal weight font as an example. Make a webpage with two spans containing a lowercase x, and set the font of one of the spans to Helvetica or Arial (the reference) and set the other span to the font you are testing. Set the font-size to 100px.
Then pull this up in a browser and take a screen shot. Load the screenshot into a photo editor and measure the height of both of the x.
(NOTE: this was captured on a retina display, so I divide the measurements by 2.)
In this case the Helvetica would measure an x-height of about 52px (on retina it was 105). If your font is smaller, you need to determine the difference percentage by dividing the reference by your font (& multiply by 100 for the percentage). If your font is 45px, such as this Times New Roman (half of the 91 shown), then
52/45 = 1.1555 * 100 = 115.5%
So to make your font with the x-height of 45 equal to the reference, instead of 100px, set it to 115.5px
Of course 100px is too big for a font, but lets say for a pair of colors the APCA lookup indicates a 16px font. Multiply by 1.1556 and you get an 18.5px font.
Why Cursive?
Make the fallback font after your test and reference fonts something very different such as cursive. This way if the browser is not loading the font properly it is immediately obvious:
My Helvetica reference didn't load due to a path error on my test page. Finally found a good use for that cursive font... LOL.
Weight
While size per x-height is fairly straight forward, weight is not so much. There is active research into possible tools, for the time being a visual reference is needed.
In this case, it is usually best to set up a quick test with the fonts near the eventual size. Let's say we want to set our text at 18px (for reference) this would be about 21px for our FontyMcFont. After adjusting for size, we either need to find the weight of Helvetica that matches our font, or font a weight of our font that matched Helvetica (in this case at weight 400). Because Helvetica is available nine weights from 100 to 900, let's find the relevant Helvetica.
We'll make a few lines to compare different weights, and one with high contrast, and another set with very low contrast to exacerbate the differences. The test text is
400 & IcyATOMsizedgap
indicating the weight (remember to change it based on the style!)& IcyATOMsizedgap
is a line of test text I like to use as it's short yet demonstrates most of the common design differences in a font. (Think of "mind the gap" on the London tube in winter).Below, a test setup for the RALEWAY Google font:
So here, find the closest visual match in terms of weight. If we look at a screenshot:
We see that Raleway is clearly lighter than Helvetica. The 300 Raleway is perhaps slightly heavier than Helvetica 300, and this is clearly closest in this comparison, so we re-rate Raleway 400 as being 300.
Here it is closeup:
A look to the lo con version on the left really highlights the weight differences.
TL;DR
Following a simple procedure, compare your design font to a reference font and determine the offset needed for equivalence.
This is an area of ongoing research and development.
Thank you,
Andy
Andrew Somers
W3 AGWG Silver LVTF Invited Expert
Senior Color Science Researcher
Myndex Perception Research
Creator of APCA contrast
THE REVOLUTION WILL BE READABLE
Beta Was this translation helpful? Give feedback.
All reactions