W3C home > Mailing lists > Public > www-style@w3.org > March 2016

Re: Unicode request for CSS property to control emoji style [I18N-ACTION-500]

From: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
Date: Sun, 27 Mar 2016 14:42:37 -0600
Message-ID: <CAFDDJ7yYEPky+yHVPVeNLCReTpstM1+sqq00paiKpOixER6HRw@mail.gmail.com>
To: Xidorn Quan <quanxunzhen@gmail.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, "Phillips, Addison" <addison@lab126.com>, "www-style@w3.org" <www-style@w3.org>, intlcore <public-i18n-core@w3.org>, Mark Davis ☕️ <mark@macchiato.com>
This discussion seems to be focused on the situation where the preferred
font has both multi-color and monochrome versions for a character, deciding
which one should be selected.

This seems a natural choice for a font-variant-* property.  As Cameron
said, this switch isn't even specific to emoji characters, although having
an `multicolor-if-emoji` option that defers to the Unicode emoji setting
for each character is useful.

The more prevalent situation, however, is whether the text layout engine
should replace the glyph from the normal font stack with a multi-color
glyph from the system emoji font (as many browser/OS combinations currently
do).

This second issue is more complex, as it somewhat up-ends the normal glyph
selection rules.  Essentially, the behavior of many user agents (e.g., most
browsers on mobile) is to treat the generic emoji font as if it is the
first choice in every font stack.  In contrast, other UAs (e.g., Firefox on
Windows) treat the emoji glyphs as part of a generic fallback font that is
only displayed if the author-specified font stack does not have a glyph for
the character.

This is not a font-variant-* option, as it isn't a property of a particular
font, but of how the font stack is used to resolve a given character.

Some practical cases to consider:

1) The author provided explicit font settings for a design which should be
rendered with specified color (or SVG paint) styles for all the characters,
even usual emoji characters.

I don't think this is currently possible on systems that usually substitute
their own emoji glyphs.

2) The author wants characters to be displayed using the system emoji font
if available, but has also provided a web font as a fallback to ensure that
glyphs can be rendered even if not supported in the system font.

Currently, the only way to do this in Firefox is to add Firefox's default
emoji font to the top of the font stack.  If other browsers adopt the same
behavior, more font names would be required.  It will become easier when
the generic `emoji` font keyword is well-supported, but it's still kind of
weird to put a generic font keyword at the top of the font stack instead of
as the fallback.

Having the emoji font as the first font in the stack also has side effects,
preventing font-variant settings from being applied to the text rendered in
the primary font (which is now listed as a fallback in the font-family
property).  There are probably some workarounds that use @font-face's
Unicode range option to synthesize a font family consisting of the correct
glyphs for each character, but that's getting painfully complex.


In other words, I think a new property would be required that specifically
instructs the user agent to substitute (or not) emoji glyphs, regardless of
font-family settings.


~ABR
Received on Sunday, 27 March 2016 20:43:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC