Open litherum opened 7 years ago
Currently, WebKit has no concept of variation selectors. However, macOS and iOS do. In CoreText, VS15 and VS16 are treated specially.
If a code point has VS16 attached to it, font selection will only ever select a color font to show the code point (if one exists). If a code point has VS15 attached to it, font selection will never select a color font. A color font is one which has an appropriate table (e.g. sbix) (which can be queried by checking if the CTFontSymbolicTraits has the kCTFontTraitColorGlyphs bit set). No other variation selectors affect font selection. Once a font is chosen, an unsupported variation selector is just ignored.
I support the idea to define it better. Blink has similar logic in SymbolsIterator, but there are some edge cases I would like to test more.
In regards to VS in the font selection, I believe the spec defines the cascading for VS in general; e.g., when font-family: A, B
, and when A has the base character but doesn't have the specified VS, UA must chose B if B has the VS, or A otherwise.
cc @jfkthame
The Working Group just discussed Variation selectors are underspecified
.
We have a resolution from the 2011 F2F in Kyoto about font fallback for variations selectors:
RESOLUTION: font fallback goes all the way to system fallback with the IVS before repeating with base, will add a property to switch between that and font-consistency-priority matching
https://lists.w3.org/Archives/Public/www-style/2011Jun/0325.html
Variation selectors require some extra processing to get them right. There are two reasons for this: The 'cmap' format 14 subtable allows character mapping to accept variation selectors as input, and variation selectors are required for emoji selection but optional for other purposes.
This has implications for the
unicode-range
descriptor in @font-face, the font matching algorithm, and a possible property being discussed at https://github.com/w3c/csswg-drafts/issues/352.It seems to me that it's valuable for browsers to have interoperability regarding variation selectors.
Before making a specific proposal, I'd love to hear from the browser vendors about their current (or planned) support of variation selectors.
cc @heycam @drott @PeterCon