Skip to content

Commit

Permalink
Add some additional tests for variable font 'slnt' behavior.
Browse files Browse the repository at this point in the history
These tests cover the regression affecting the Inter variable font, fixed by the preceding patch.

Depends on D169335

Differential Revision: https://phabricator.services.mozilla.com/D169336

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1815679
gecko-commit: c8491c0074db8bc1f841c77720089583dbc72ac6
gecko-reviewers: emilio
  • Loading branch information
jfkthame authored and moz-wptsync-bot committed Feb 10, 2023
1 parent f574d4f commit 35a6d90
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
23 changes: 23 additions & 0 deletions css/css-fonts/variations/font-slant-2c.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>CSS test: mapping of font-style:oblique to opentype 'slnt' axis</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]"/>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#valdef-font-style-oblique-angle"/>
<link rel="match" href="font-slant-2-ref.html"/>
<style>
@font-face {
font-family: test;
font-style: normal;
src: url(resources/Inter.var.subset.ttf);
}
.test {
font-synthesis: none;
font: 32px/1.5 test;
}
</style>
<body>
<p>Test passes if none of the following lines are displayed with a slanted font.</p>
<div class="test" style="font-style: oblique">slant</div>
<div class="test" style="font-style: oblique 10deg">slant</div>
<div class="test" style="font-style: oblique -10deg">slant</div>
<div class="test" style="font-style: italic">slant</div>
23 changes: 23 additions & 0 deletions css/css-fonts/variations/font-slant-3-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>CSS reference file: mapping of font-style:oblique to opentype 'slnt' axis</title>
<style>
@font-face {
font-family: test;
/* Version of Inter subset with OpenType tables stripped,
so the browser's synthetic styling should take effect. */
src: url(resources/Inter.no-var.subset.ttf);
font-style: normal;
font-weight: normal;
font-stretch: normal;
}
.test {
font: 32px/1.5 test;
}
</style>
<body>
<p>Test passes if the following lines are displayed with a variety of synthetic slants.</p>
<div class="test" style="font-style: oblique 10deg">slant</div>
<div class="test" style="font-style: oblique 20deg">slant</div>
<div class="test" style="font-style: oblique -10deg">slant</div>
<div class="test" style="font-style: oblique 14deg">slant</div>
27 changes: 27 additions & 0 deletions css/css-fonts/variations/font-slant-3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>CSS test: mapping of font-style:oblique to opentype 'slnt' axis</title>
<link rel="author" title="Jonathan Kew" href="mailto:[email protected]"/>
<link rel="help" href="https://drafts.csswg.org/css-fonts/#valdef-font-style-oblique-angle"/>
<link rel="match" href="font-slant-3-ref.html"/>
<style>
@font-face {
font-family: test;
/* The font resource includes a 'slnt' axis, but our font-style descriptor
should prevent it being used to render oblique/italic styles. */
src: url(resources/Inter.var.subset.ttf);
font-style: normal;
font-weight: normal;
font-stretch: normal;
}
.test {
font-synthesis: style;
font: 32px/1.5 test;
}
</style>
<body>
<p>Test passes if the following lines are displayed with a variety of synthetic slants.</p>
<div class="test" style="font-style: oblique 10deg">slant</div>
<div class="test" style="font-style: oblique 20deg">slant</div>
<div class="test" style="font-style: oblique -10deg">slant</div>
<div class="test" style="font-style: italic">slant</div>
Binary file not shown.

0 comments on commit 35a6d90

Please sign in to comment.