Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Add CSS unicode-range #102

Open
Open
@KenjiBaheux

Description

@KenjiBaheux

http://dev.w3.org/csswg/css-fonts/#unicode-range-desc

"This descriptor defines the set of Unicode codepoints that may be supported by the font face for which it is declared. The descriptor value is a comma-delimited list of Unicode range () values. The union of these ranges defines the set of codepoints that serves as a hint for user agents when deciding whether or not to download a font resource for a given text run."

This is important for performance reasons. With unicode range, you can break a large font into smaller sets which cover specific "alphabets" (e.g. latin, cyrillic, vietnamese, chinese) or specific characters (e.g. mathematical symbols, icons in the Private Use Areas).

A compliant user agent would download the strict minimum for a given document.

With the test cases shared below, Internet Explorer 11 downloads all the fonts defined for a given font-family: all the unicode ranges as well as the fallback font (much larger binary size due to the sheer number of supported glyphs).

Test cases:

  1. : download nothing http://jsbin.com/jocodedi/1/quiet PASS
  2. "Text “Hello”: download latin"
    http://jsbin.com/cibalono/1/quiet
    FAIL: latin, cyrillic, vietnamese, fallback fonts are downloaded.
  3. Euro sign: download fallback
    http://jsbin.com/xadaluwo/1/quiet
    FAIL: latin, cyrillic, vietnamese, fallback fonts are downloaded.
  4. Text “лич”: download cyrillic
    http://jsbin.com/muwufeve/1/quiet
    FAIL: latin, cyrillic fonts are downloaded. (fallback not defined)
  5. Euro sign, no fallback font: download nothing
    http://jsbin.com/dopacilo/1/quiet
    FAIL: latin, cyrillic, vietnamese fonts are downloaded.(fallback not defined)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions