Skip to content

Commit

Permalink
Convert slant angle from CSS to OpenType for web font instantiation
Browse files Browse the repository at this point in the history
OpenType and CSS use opposite directions for the slant angle of a
variable font, compare note in [1] and test case in [2]. After the issue
was resolved in the CSS spec to keep these opposite directions, convert
from CSS to OpenType before shaping.

[1] https://drafts.csswg.org/css-fonts/#font-style-prop
[2] https://arrowtype.github.io/vf-slnt-test/

Bug: 859869
Change-Id: Ib1cc9224edab1dc17d8c6ed200e8369714cc73ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109762
Commit-Queue: Koji Ishii <[email protected]>
Reviewed-by: Koji Ishii <[email protected]>
Cr-Commit-Position: refs/heads/master@{#752096}
  • Loading branch information
drott authored and chromium-wpt-export-bot committed Mar 20, 2020
1 parent cf301c5 commit c98c762
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions css/css-fonts/matching/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Using the **Variable Test Axis Matching** font, [reference tests](https://web-pl

## Font Glyphs Reference

The following table explains the relationship between the M, N, O, P variation axis controlled glyphs and the non-scaled glyphs used as references.
The following table explains the relationship between the M, N, O, P variation axis controlled glyphs and the non-scaled glyphs used as references. The values are specified as OpenType axis parameter values. CSS values are mapped to to those values, for example from CSS font-weight values straight to `wght`, for width from percentages straight to `wdth`. For `slnt` the CSS values are positive clockwise, but the OpenType values are positive turning counterclockwise. Here the mapping is inverted, i.e. the CSS value is multiple by -1. Compare the note in [the CSS font style property](https://drafts.csswg.org/css-fonts/#font-style-prop).

| Bar Length in FUnits | 200 | 400 | 600 | 800 | 1000 | 1200 | 1400 | 1600 | 1800
| :---: | :---: |:---: |:---: |:---: |:---: |:---: |:---: |:---: |:---: |
| Glyph **N**, Style, `slnt` | -90.00% | -67.50% | -45.00% | -20.00% | 0.00% | 20.00% | 45.00% | 67.50% | 90.00%
| Glyph **M**, Stretch Axis `wdth` | 50% | 62.50% | 75% | 87.50% | 100% | 112.50% | 125% | 150% | 200%
| Glyph **N**, Style, `slnt` | 90 | 67.5 | 45 | 20 | 0.00 | -20 | -45 | -67.5 | -90
| Glyph **M**, Stretch Axis `wdth` | 50 | 62.5 | 75 | 87.5 | 100 | 112.5 | 125 | 150 | 200
| Glyph **O**, Style, `ital` | 0 | 0.125 | 0.25 | 0.375 | 0.5 | 0.625 | 0.75 | 0.875 | 1
| Glyph **P**, Weight, `wght` | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
| **Ref Glyphs for:** | | | | | | | | |
Expand Down
Binary file modified css/css-fonts/matching/resources/variabletest_matching.ttf
Binary file not shown.

0 comments on commit c98c762

Please sign in to comment.