The font-tech() and font-format() are extensions to the @supports rule CSS Conditional Syntax enable declarative and programmatic access to feature detection of font stack features. Using these conditions together with @supports allow progressive enhancement of content depending on font format support. In particular with UAs differing in support for color font formats, this is useful for including color font style rule and @font-face definitions only if the user agent supports it. Using JS CSS.supports() calls this is also the first ergonomic way of testing for font stack capabilities on the web without UA sniffing or canvas pixel readback as in Chromacheck (https://pixelambacht.nl/chromacheck/).
This feature is closely related to the @font-face src: descriptor syntax extension which was recently discussed and LGTM'ed here: - the same font format and technology keywords are used and synchronized between these two features.
Motivation
While font files look the same from the outside in their mime type and file signature, they may contain information that requires specific features of the UA's font stack.
If an author wants to progressively enhance their site depending on font format capabilities of the UA, feature detection is needed. This feature here provides such a capability on the client side in two ways, declaratively in CSS, or programmatically in JS using CSS.supports().
Examples:
This feature is intended for situations where the progressive enhancement choice is made client side. Feature detection on the server side, at the time for example the UA makes a request for a style sheet is out of scope for this proposal. In those situations, UA sniffing on the server side is still performed on the server based on request headers and user-agent string - which may be addressed by font feature client hints in the future.
Low: If this feature is not supported, the respective CSS styles are not included, so the progressive enhancement fails, which is the nature of this approach. If CSS.supports() calls are failing because they are not available, then the program logic trying to feature detect font stack capabilities, may need to resort to other methods of testing font support, for example through Canvas pixel probing or hardcoded UA lists.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
No.
Equivalent to other @supports debugging.
108
Additional keywords may be added in the future.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN6muBvYtHHtgDGtJ-7j%3DJdzWTOA8MFf8O6VT%3DOyovcfYihmog%40mail.gmail.com.
LGTM2
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfVFHFsAxh164yJKC8%3DdZEUA9QnQn4kSi4K1R4TtSEUWqw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/af6ad6e4-ada1-8035-0924-9aa28d0af32e%40gmail.com.