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

VF: Consider negating slant angle #175

Closed
rsms opened this issue Jul 19, 2019 · 3 comments
Closed

VF: Consider negating slant angle #175

rsms opened this issue Jul 19, 2019 · 3 comments
Assignees

Comments

@rsms
Copy link
Owner

rsms commented Jul 19, 2019

See #172

TODO:

  1. Investigate further if there are some open bugs in Chromium related to slnt-oblique-italic mapping
  2. Consider using "ital" axis instead of "slnt" axis — there may be differences/bugs in the implementation of Safari, Chrome, et al
  3. Consider reverting the italicAngle change introduced by e45e2e5 and sticking with positive angles as it seems to work correctly in practice.
@thundernixon
Copy link
Contributor

Just a question to clarify:

In the tests using font-style: oblique 10deg, did you run this on a font with a slnt value of 0 to -10, or 0 to 10? It seems like you only ran tests which matched positive with positive and negative with negative.

Going by the specs, things should be like this for forward-slanting styles:

  • In the font, the sltn axis and italicAngle should be negative
  • In the CSS, the angle should be positive in the font-style: oblique __deg

The CSS working group acknowledges that these values are opposite, here:
https://drafts.csswg.org/css-fonts-4/#font-style-prop

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.

Looking at your tests today, they seem to be missing one that follows both specs:

  • a slnt of -10 in the font
  • a font-style with oblique 10deg in the CSS

Would you be willing to run that and share the results? I'm guessing you still have that test webpage around somewhere, so hopefully it's a quick task.

@thundernixon
Copy link
Contributor

My guess is, it won't work as it should, based on my own experiments.

image

image

@thundernixon
Copy link
Contributor

thundernixon commented Jul 20, 2019

As for this point:

Consider using "ital" axis instead of "slnt" axis

It's a pretty good idea! The slnt axis doesn't really follow exact degree angles perfectly anyway, and ital goes from 0 to 1, which is more intuitive than the negative values of slnt. I wanted to test this approach in my own project.

Unfortunately, it's buggy in its own ways.

Whether I use font-style: oblique 0deg 15deg; or font-style: oblique 0deg -15deg; or font-style: normal italic; in my @font-face, I get the following results in this CodePen test.


Safari: font-style: italic does turn on italic alternates as I want (a GSUB rule is working), but it appears to both add the italic angle from my font, plus its own synthetic additional 15deg slant.

image


Chrome: doesn't apply ital axis at all.

image


Firefox: the closest to rendering as expected. Applies the proper ital slant, with the forms as drawn rather than with synthetic slant. Doesn't cue my ital-linked GSUB alternates, however.

image


It may be confusing that I'm adding another variable here for CRSV (cursive). This simply allows that italic alternates to be always-off, auto-on (controlled by ital axis), or always-on.

Kapture 2019-07-20 at 15 39 11

So, font-style: italic; should turn ital to 1, which would slant my font to 15° and activate cursive alternates. But, that's not happening yet.

I'd be curious to see whether things are any different in Inter, but I think this is probably something we'll need to file as a bug report with browser vendors.

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

No branches or pull requests

2 participants