Re: [csswg-drafts] [css-fonts] @font-face source: reference to OpenType Collection without a fragment identifier (#10127)

ISTM that explicitly saying a collection without a fragment ID (font name) is ignored as invalid would be just as straightforward, and more consistent with the general rejection of indexing into the collection.

I'd argue that if no fragment is provided in the `src: url(...)` descriptor, the URL's fragment is null (per https://url.spec.whatwg.org/#url-representation), and therefore a strict reading of the Fonts spec implies that we have to select a face from the collection whose PostScript name is null; any font with a non-null psname clearly does not satisfy this URL.

So on reflection, I think that's the most reasonable reading, and should be made explicit in the spec (rather than having a fragile index-based default).

While we're here, I'd also like to take issue with the wording of

> Conformant user agents must skip downloading a font resource if the fragment identifier is unknown or unsupported.

because AFAICT the user agent cannot know whether the fragment identifier is known or not (as the postscript name of a face in the collection) until it has downloaded the resource. So it's too late to "skip downloading", unless the UA can determine that the fragment identifier _cannot_ be a valid postscript name (e.g. because it contains characters that would be illegal).

So maybe something more like

> Conformant user agents must not use a face from the resource unless its PostScript name exactly matches the fragment identifier, and should skip downloading the resource if the given fragment identifier cannot be a valid PostScript name.

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


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

Received on Tuesday, 26 March 2024 17:10:06 UTC