Skip to content
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

What can you do about a fail in Microsoft Font Validator "AvgCharWidth" #1894

Closed
EbenSorkin opened this issue May 29, 2018 · 13 comments
Closed
Assignees

Comments

@EbenSorkin
Copy link

Observed behaviour

I get this MS-FonVal: The xAvgCharWidth field does not equal the calculated value DETAILS: actual = 541, calc = 548

Expected behaviour

I am not sure what I expect instead but I would like suggestions about how to address this either here or ideally in the tool because I don't see a way to deal with it in Glyphs. It might be the naswer is use font forge or FL5? Is it?

Resources and exact process needed to replicate

Here is a file to test with
Aplos-Regular.ttf.zip

@m4rc1e
Copy link
Collaborator

m4rc1e commented May 29, 2018

I hate these avg width tests as well. I've written about them here #1622.

Imo, I only really care about the glyf checks in Ms Validator. Can we just check this table using Ms Val's table param? mono FontValidator -file font.ttf -table 'glyf' -reportdir ~/Desktop

After Rubikgate, I check font rendering using Browserstack.

It may be worthwhile for us to review all the checks Ms Val offers.

@felipesanches
Copy link
Collaborator

It may be worthwhile for us to review all the checks Ms Val offers.

There's a task for that: issue #1541

@davelab6
Copy link
Contributor

davelab6 commented May 29, 2018 via email

@felipesanches
Copy link
Collaborator

felipesanches commented May 29, 2018

My vague understanding of the xAvgAdvanceWidth value is that it might be used for font substitution algorithms by estimating how much space some arbitrary text may take on screen/paper and then comparing this value with all other available fonts' xAvg values to decide which other font would have the same effect in terms of image buffer area usage.

The description above is my interpretation after hunting down the historical origins of this field. I found no place online (neither at O'Reilley's "Fonts & Encodings" book by Yannis Haralambous) where I could get a straight & precise description of the actual usage of the value. All I could found was vague descriptions followed by somewhat precise specs on how to compute it. But I got no real answer to the "why" question.

The way this is computed may involve a weigthed sum. And I guess this is an attempt to shape the value into something meaningful when comparing text written in some language, by means of weigthing the sum with the frequencies of occurences of each letter in that given language.

Since nowadays the world is pretty much biased towards english (and this bias is specially pronounced in technology, unfortunately) I would guess that the frequency weigths used in the opentype spec were originally computed based on some reference english text, making it completely useless for font substitution in any other language.

I spent some time looking up the freetype codebase to see where xAvgAdvanceWidth is used. The codebase is big and so I am not sure (it would require some more time to have a definite answer), but I had the impression that even though the value is parsed and used in computing a "width" property of font strikes of all of the available fixed sizes, this same width property does not seem to be actually used anywhere else. But, again, I may be wrong about it. Might be easier to ask the freetype devs.

I obviously lack access to the sources of Mac and Windows font engines, but I wonder if anyone knows if this is actually used somewhere...

@felipesanches
Copy link
Collaborator

It might also be used on the application level, but it seems to me that font substitution is very much font-engine business.

@davelab6
Copy link
Contributor

davelab6 commented May 29, 2018 via email

@felipesanches
Copy link
Collaborator

Sounds like we should forget about it then! Should this lead to a deprecation? Or is this check useful at all nowadays?

@davelab6
Copy link
Contributor

davelab6 commented May 29, 2018 via email

@EbenSorkin
Copy link
Author

Thanks!

@HinTak
Copy link

HinTak commented Jul 30, 2018

This was perhaps fixed post 2.1
. See HinTak/Font-Validator#33

@EbenSorkin
Copy link
Author

EbenSorkin commented Jul 30, 2018 via email

@felipesanches
Copy link
Collaborator

A coupe weeks ago I made a change to the FVAL check on Font Bakery so that it overrides a feel FAILs to be treated / reported as simply WARNs:

https://github.com/googlefonts/fontbakery/pull/1975/files

@felipesanches
Copy link
Collaborator

This change will be included in the upcoming 0.5.0 release.Or you can already benefit from it in case you're running Font Bakery directly from git sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants