fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
553 stars 102 forks source link

Add check for slnt values are within a common but unintuitive range #2572

Closed davelab6 closed 5 years ago

davelab6 commented 5 years ago

Observed behaviour

I just saw a VF that has a slnt axis that is currently ranged from 0.0 to 15.0 but sadly https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_slnt says,

Note that the scale for the Slant axis is interpreted as the angle of slant in counter-clockwise degrees from upright. This means that a typical, right-leaning oblique design will have a negative slant value. This matches the scale used for the italicAngle field in the post table.

That means the range should be 0.0 to -15.0

Expected behaviour

We should check for slnt axes with positive values and WARN if they are encountered, because such values are intended for 'back slanted' designs.

m4rc1e commented 5 years ago

Found this in https://github.com/google/fonts/pull/1908

cc @thundernixon

thundernixon commented 5 years ago

@davelab6 (You are correct – thank you for bringing this to my attention! I'm just not exactly sure where the best place is to ask questions around this spec, so maybe you could point me in the right direction).

I suspect this will cause a lot of user confusion, particularly because the CSS spec for font-style: oblique assumes a clockwise measurement:

Note: the OpenType slnt axis is defined with a positive angle meaning a counter-clockwise slant, the opposite direction to CSS. The CSS implementation will take this into account when using variations to produce oblique faces.

https://drafts.csswg.org/css-fonts-4/#font-style-prop

This can't really change in the CSS spec, because many things in CSS follow a clockwise orientation, such as "top-right-bottom-left" values for margin, padding, borders, etc.

Also, of course, for anyone writing in a left-to-right language or familiar with analog clocks, it's hard to predict that a negative value would make letters slant rightward.

I imagine a primary difficulty with changing the OT spec is that many fonts have already been produced with this unintuitive value for italicAngle... Still, now that end-users will have direct control over slant for fonts with this axis, this negative-value convention will be so obnoxious for anyone making a variable font axis UI. Do sliders for slnt start at 0, all the way to the right? Or do those get flipped, to put negative values to the right? What if one vendor flips this, but others stick with the easier implementation? It will likely be an uphill UX battle for each software vendor and probably for many type designers.

How unchangeable is the OT spec? Would a change like this have to wait for OT 1.9 or 2.0? Is there somewhere better I can complain about this?

felipesanches commented 5 years ago

Screenshot at 2019-08-09 05:41:53