On 21/03/2018 08:03, dr...@chromium.org wrote:
font-{weight,stretch,style} are parsed and hooked up to the variable fonts
rasterization backend since we initially shipped OpenType Variations in M62. I
implemented this in Blink, so if you are observing any issues, mind sharing
them? I'd be happy to take a look.
Hi Dominik,
Thanks for the note - that's interesting. Maybe I'm missing something?
Simple testcase (requires Avenir Next Variable installed):
<!DOCTYPE html>
<meta charset=utf-8>
<style>
body { font-family: Avenir Next Variable; font-size: 24px; }
</style>
<body>
<script>
for (i = 400; i <= 700; i += 50) {
e = document.createElement("div");
e.textContent = "font-weight " + i;
e.style.fontWeight = i;
document.body.appendChild(e);
e = document.createElement("div");
e.textContent = "variation wght " + i;
e.style.fontVariationSettings = "'wght' " + i;
document.body.appendChild(e);
}
</script>
When I view this with Chrome, I see the expected range of weights for
the elements that use font-variation-settings. But those using
font-weight are all rendered with the default weight of Avenir, just
with a slight (and constant) synthetic-bold effect applied at
font-weight:550 and higher.
This led me to believe something isn't completely hooked up.... on
further experimentation, though, I find that it does work as expected if
the font is loaded from a @font-face resource with the appropriate
descriptors. So this seems to be only a limitation for installed fonts?
JK
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform