Re: [csswg-drafts] [css-fonts-4] [varfont] Supported variation font axes and font features are not discoverable

Using a media query for this wouldn't work because media queries have 
no concept of a specific font face to investigate. Instead, it seems 
that such a mechanism would have to be in JavaScript.

The canvas text metrics API and the forthcoming Houdini text metrics 
API expose some other font-driven information. However, these APIs 
give you information about a line (or lines) of text, and would 
include things like fallback fonts. Variation axes and features are 
font-specific, so including fallback fonts isn't the right level of 
abstraction for solving this problem.

A natural place to put this would be to build off of the CSS Font 
Loading API. This API already has the concept of an object which 
represents a font face. In addition, a FontFace even already has a 
"status" enum property which has a relationship to a specific url() 
inside the FontFace (so there is precedent for this idea already). 
Calling the function on an in-flight download would result in an 
exception or something. Maybe a function can be added to FontFace 
which returns a new object which has a bunch of properties including 
font info.

Any thoughts? @tabatkins @bramstein @nattokirai @SergeyMalkin @drott 
@heycam 

P.S. According to caniuse, Edge hasn't implemented the CSS Font 
Loading API, so they would probably have to implement at least some of
 it in order to go with this proposal.

-- 
GitHub Notification of comment by litherum
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/520#issuecomment-264532643 
using your GitHub account

Received on Friday, 2 December 2016 18:54:31 UTC