W3C home > Mailing lists > Public > www-style@w3.org > April 2015

[css-font-loading] controlling font loading display

From: John Daggett <jdaggett@mozilla.com>
Date: Mon, 13 Apr 2015 14:47:58 +0900
Message-ID: <CALYZoVN54J+JJ63+sjnCOc_O4N1EgWBdCD6RG+8vRe9W4sGaAA@mail.gmail.com>
To: www-style <www-style@w3.org>
I'd like to propose a simpler property for controlling font display
while downloadable font resources are loading. I think the previous
proposal [1] is overly complex and the value names aren't terribly
intuitive.

The 'font-loading-display' property below gives authors an
effective way to control this:

  font-loading-display: auto | fallback | blank-fallback | blank

Value definitions:

  auto

  The user agent selects what to display while fonts are loading for a
  particular text element, based on the optimal balance between
  displaying some form of text and laying out the page multiple times.

  fallback

  For text content that uses a currently loading font resource,
  immediately display text using a fallback font instead (i.e. the font
  that would be used if the font resource was unavailable). After the
  font resource is loaded, display text using the font resource.

  blank-fallback

  For text content that uses a currently loading font resource,
  initially display text transparently using some form of fallback font.
  If the font is still available a small time later (e.g. 3 seconds),
  display using the fallback font. After the font
  resource is loaded, display text using the font resource.

  blank

  For text content that uses a currently loading font resource,
  initially display text transparently using some form of fallback font.
  After the font resource is loaded, display text using the font
  resource. In situations where font loading takes an excessive amount
  of time, user agents should display text using fallback fonts.

Among existing user agents Firefox/Chrome implements 'blank-fallback' by
default, Safari implements 'blank' and IE implements 'fallback'.

I think it's much, much simpler to have just a property and avoid the
complexity for authors and implementers involved with having both a
property and an @font-face descriptor.

I also think the 'optional' value is an unnecessary addition. It's
subtly more complex to define and implement than the spec writers assume
and it introduces a certain amount of randomness to how text displays
for a page, since the usage will be dictated by implementation resource
constraints. Authors that really want to implement this behavior can
achieve something similar with the Font Loading API instead.

Cheers,

John Daggett

[1] https://lists.w3.org/Archives/Public/www-style/2015Mar/0381.html
Received on Monday, 13 April 2015 05:48:27 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC