WICG / canvas-formatted-text

Other
80 stars 17 forks source link

Supporting Colour fonts? (Black & White and Colour glyphs?) #35

Open travisleithead opened 2 years ago

travisleithead commented 2 years ago

(This is internal Microsoft feedback from a review of the spec by resident expert @petercon. Re-posting here with permission.)


Rendering: something I don’t see mentioned at all is colour fonts. A given OpenType font can potentially support BW and colour glyphs, and could even support alternate formats for colour glyphs (COLR table, SVG table, …). The choice of colour vs. BW doesn’t affect layout or line metrics (though it might affect glyph bounding boxes); but obviously it affects rendering. Canvas 2D context doesn’t seem to handle this currently itself, so does that constrain you? I may be overlooking something already there, but it seems like a gap.

travisleithead commented 2 years ago

If CSS provides a property to configure/control this selection of b&w or colour glyphs (font-variant-alternates?) then this should be covered in the FormattedText data model. If not, then I would defer to the CSS WG to surface this via a CSS property rather than provide a unique way to do it for FormattedText alone.