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

make slant and italicAngle values negative, per OT spec #172

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

thundernixon
Copy link
Contributor

As flagged in fonttools/fontbakery#2572, forward-slanting italics must have a negative value for slnt and for their italicAngle, per the OpenType spec.

This is unintuitive (and doesn't match the behavior of the CSS oblique property), but:

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.

https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxistag_slnt

This PR changes all slant and italicAngle values to negative, to align with the spec.

@thundernixon
Copy link
Contributor Author

Note: this only touches the source, so you'd still need to make changes build into releases, etc, to complete this update.

@thundernixon
Copy link
Contributor Author

thundernixon commented Jul 13, 2019

I questioned why the spec is the way it is and received some helpful answers that it's because the italicAngle follows mathematical conventions rather than web conventions. Hopefully, design tools are able to make this unintuitive (in my mind) part of the spec more intuitive for end-users.

https://twitter.com/ArrowType/status/1149816958243749890

@rsms
Copy link
Owner

rsms commented Jul 19, 2019

Thank you!

@rsms rsms merged commit e45e2e5 into rsms:master Jul 19, 2019
@rsms
Copy link
Owner

rsms commented Jul 19, 2019

Hm... After updating and now testing this out, it seems negative oblique angles are not supported by Chrome at all and are only partially supported by Safari.

I'm out of this this morning, but I do have a bit of time this weekend to keep looking into this. It looks like reverting to a positive angle might be the best course of action for now since it seems that at least web browsers expect a positive-value angle.

Note: Explicitly setting font-variation-settings: "slnt" -10 does work but font-variation-settings is an all-or-nothing kind of deal—it resets and overrides all other features, making it pretty cumbersome to use in practice.


Chrome 75 with latest release: (positive oblique angle)
Screen Shot 2019-07-19 at 09 00 30


Chrome 75 with build from master: (negative oblique angle)
Screen Shot 2019-07-19 at 09 00 26


Safari 12.1 with latest release: (positive oblique angle)
Screen Shot 2019-07-19 at 09 07 29


Safari 12.1 with build from master: (negative oblique angle)
Screen Shot 2019-07-19 at 09 07 14


CSS

Positive slant angle (stable)

@font-face {
  font-family: 'Inter var experimental';
  font-weight: 100 900;
  font-style: oblique 0deg 10deg;
  font-named-instance: 'Regular';
  src: /*...*/
}
  • Style property for explicitly angled text: font-style: oblique 10deg
  • Style property for symbolically angled text: font-style: oblique

Negative slant angle (stable)

@font-face {
  font-family: 'Inter var experimental';
  font-weight: 100 900;
  font-style: oblique 0deg -10deg;
  font-named-instance: 'Regular';
  src: /*...*/
}
  • Style property for explicitly angled text: font-style: oblique -10deg
  • Style property for symbolically angled text: font-style: oblique

@rsms
Copy link
Owner

rsms commented Jul 19, 2019

Idea I'd like to try: Use "ital" axis instead of "slnt" axis — it's possible there are bugs in Chrome and Safari related to mapping slant-italic-oblique.

@rsms
Copy link
Owner

rsms commented Jul 19, 2019

Tracked here: #175

@arrowtype
Copy link

There are definitely browser bugs. I've written about this a bit here (this also links to a post about this from Jason Pamental):

arrowtype/recursive#56

It's really interesting to see the results of the test for positive vs negative slant values. Are you sure that none of those are synthetic slants (i.e. not your corrected italic drawings)?

rsms added a commit that referenced this pull request Aug 2, 2019
rsms added a commit that referenced this pull request Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants