From c98c76256173b7d3e596debb4e0ce8ad0c4e4c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20R=C3=B6ttsches?= Date: Fri, 20 Mar 2020 11:31:54 -0700 Subject: [PATCH] Convert slant angle from CSS to OpenType for web font instantiation 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 Reviewed-by: Koji Ishii Cr-Commit-Position: refs/heads/master@{#752096} --- css/css-fonts/matching/README.md | 6 +++--- .../resources/variabletest_matching.ttf | Bin 4552 -> 4544 bytes 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/css/css-fonts/matching/README.md b/css/css-fonts/matching/README.md index 653f4d933cd0ee..7d333c5bca5145 100644 --- a/css/css-fonts/matching/README.md +++ b/css/css-fonts/matching/README.md @@ -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:** | | | | | | | | | diff --git a/css/css-fonts/matching/resources/variabletest_matching.ttf b/css/css-fonts/matching/resources/variabletest_matching.ttf index 307af4926cbac28f923feebc69d653894e50f560..7a09643083b14d0573f88dafca1aaf6fadb9338f 100644 GIT binary patch delta 349 zcmX@1d_Z}EIOC3q5;H`~O&*_TU=WzVz`&@Mk(!ty_CY6f;*kOw-7`h{Gel7vHZU>BFt9f;901t{0zkF{n8Con%*4RR z==kTsp9c+1^^VL6%nA)n3@{B0FfBk03{WjB%s>r{V3m!{V2zE<4U7x|AVWdG0f?b$ w*c{j#8k-@e@hkv}gTMi>^9PaYHwQ3A^Vdr;m@>F9#8VwIF~~6REMPbQvJC`)YzHudfq|KcfsxVi z&x1b?8k*`M9A*V(g@z^ukS5**KxGFYO2KRgFq?%Ls0pI0u^Gw%>1u3dU}O-0=wbj{ w0hMHPU~>RUg3Sb44gm)kU@Adsfp*IS&HTIK?}~;dn3*q_Ux2g$LlQ&)05)|