Re: [csswg-drafts] [css-fonts-5] Make `unicode-range` syntax suck less (#7921)

Ideas and related work:

> 1. It's hard to read, even if you want to specify specific characters, you need to find their codepoints

For this, I'd propose allowing `<string>` as well, and treating it as specifying the set that is derived from the union of all codepoints in the string. E.g. this would be valid:

```css
unicode-range: "&";
```

> 2. Broader character classes (e.g. Japanese letter, Emoji, Digit) need to be specified manually, which is error-prone

For this there has already been discussion in https://github.com/w3c/csswg-drafts/issues/4573 and just needs spec edits.

> 3. There is no exclusion syntax (all characters in the font minus these), the range needs to be tediously constructed by starting from `U+0000` and ending at `U+FFFF` breaking as needed in between.

Perhaps we need some kind of *not* operator. This can even be just a keyword (`not`, `exclude`?) in front of existing value syntax:

```
<urange> = <urange> | not <urange>
```

Which would allow things like:

```css
unicode-range: greek, not japanese, not U+A5;
```

Or a minus operator and a keyword for all characters? 

```css
unicode-range: greek except "π";
```

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 19 October 2022 17:27:07 UTC