Re: [csswg-drafts] [css-fonts] Propose adding lang as a font-face descriptor

Here's a specific use case:

The [Noto](https://www.google.com/get/noto/) collection of fonts includes sans & serif fonts for most modern languages. [For CJK, that means multiple fonts for the same code points](https://www.google.com/get/noto/help/cjk/), optimized for each language.  They offer both subsetted font files (with just the glyphs for one language) and full CJK fonts, with the specified language as the default and the others available through OpenType features.  Of course, the full fonts are much larger files.

For a website that is primarily in one language, but wants to have compatible glyphs for occasional content in another language, it would be preferable to be able to use the subsetted font files, only downloading the additional language when it is required:

```css
@font-face {
font-family: Noto Sans;
src: url(.../noto-sans-jp.woff2);
lang: jp;
}
@font-face {
font-family: Noto Sans;
src: url(.../noto-sans-kr.woff2);
lang: kr;
}
@font-face {
src: url(.../noto-sans.woff2);
unicode-range: /* whatever would be the ascii/latin range */
}
```

The last rule shows how we can currently use `unicode-range` to do language fallbacks where the scripts have different unicode code points. But we can't do it for language-based switching of glyphs for a single codepoint.  That is only available through OpenType features in a single font file -- or through the browser font selection algorithm for generic font families.

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1744#issuecomment-323564016 using your GitHub account

Received on Sunday, 20 August 2017 05:08:49 UTC