Re: [csswg-drafts] [css-fonts-4] src: local() font unique name matching ambiguous & restricts matched locale

The CSS Working Group just discussed `Fonts`, and agreed to the following:

* `RESOLVED: local() matches against both full font name and postscript name`
* `RESOLVED: Investigate whether it's practical to implement multi-locale name matching`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: Fonts<br>
&lt;fantasai> drott: I raised this issue<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/3177<br>
&lt;fantasai> drott: It's about the local() value of font-face<br>
&lt;fantasai> drott: Used for uniquely identifying font on the local system<br>
&lt;fantasai> drott: Identifies one font<br>
&lt;fantasai> drott: Current description that it can only match the ??? name and the ??? name<br>
&lt;fantasai> drott: First want to expand it to ???<br>
&lt;fantasai> drott: We want the authors to have more success in actually matching the font<br>
&lt;myles_> s/???/Arial Bold Condensed/<br>
&lt;fantasai> drott: Currently spec asks authors to add both names to the src descriptor<br>
&lt;fantasai> drott: So current proposal is to match both, help authors have more success in matching thefont<br>
&lt;fantasai> drott: Second part of the proposal is about which locale/language to match against<br>
&lt;fantasai> drott: Currently the spec says only match the US-en version first<br>
&lt;fantasai> drott: If this one cannot be found, then try to match the first one encoded in the font<br>
&lt;fantasai> drott: I find this aspect of the font rather arbitrary, and don't think we should be doing this<br>
&lt;fantasai> drott: I'm not so worried about conflicts here<br>
&lt;fantasai> drott: If any questions, be happy to answer those<br>
&lt;fantasai> heycam: Do we have any requirements on matching non-local font names?<br>
&lt;fantasai> drott: If you don't use the local() value, you do family style matching<br>
&lt;fantasai> heycam: But in terms of what the family name is matched against?<br>
&lt;fantasai> drott: family name matches against the family name<br>
&lt;fantasai> drott: Fonts have three name entries<br>
&lt;fantasai> drott: There's family name<br>
&lt;fantasai> drott: and then full font name<br>
&lt;fantasai> drott: and postcript name<br>
&lt;fantasai> drott: In regular font-family matching, you match that against the family prart<br>
&lt;fantasai> heycam: Is it true that some implementations match the postcript name for font-family?<br>
&lt;fantasai> drott: I believe so<br>
&lt;fantasai> drott: But the matching is not so sharp for family<br>
&lt;fantasai> drott: You leave it to the matching algorithm to find the closest font to  what you specified<br>
&lt;fantasai> drott: But for local() you have to match exactly, that's the intent<br>
&lt;fantasai> myles_: I think both of these are good for the web platform, I just dont' know how to actually implement them.<br>
&lt;fantasai> myles_: If someone knows how, that'd be great, happy to do it.<br>
&lt;fantasai> drott: Maybe don't specify as a MUST<br>
&lt;fantasai> drott: But I think we should remove the current specification that says english first, otherwise physically-first entry in the name table which seems pretty random<br>
&lt;fantasai> drott: I think Firefox implements this on all platforms<br>
&lt;fantasai> drott: Windows has DirectWrite API<br>
&lt;fantasai> drott: Fixing in Chromium, I also did this on LInux and Android so far<br>
&lt;fantasai> drott: Maybe not with CoreText, but iI think we can find a language that would allow implementations to do this<br>
&lt;fantasai> astearns: Is your suggestion to keep English first, but allow other matching, or drop any mention of English?<br>
&lt;fantasai> drott: I would prefer to match any<br>
&lt;fantasai> astearns: Do you have any particular spec language or just looking for agreement to go in this direction?<br>
&lt;fantasai> drott: don't have spec language ready, but agreement to go in that direction would be OK<br>
&lt;fantasai> astearns: so proposed resolution is to loosen font name atching requirements and allow more matching than is curretnly allowed<br>
&lt;fantasai> drott: Specifically to match both font names, and secondly to match against all languages<br>
&lt;fantasai> dbaron: Allow or require?<br>
&lt;fantasai> astearns: For the first part, full name and postcript name, would that be allowed or required?<br>
&lt;fantasai> drott: Required<br>
&lt;fantasai> drott: But for second part, locale-matching, would allow. not sure there's consensus to require<br>
&lt;fantasai> dbaron: My concern is that we'll end up in situations where impls do diferent things<br>
&lt;fantasai> dbaron: I'm more comfortable going with a requirement either way than to do MAY<br>
&lt;fantasai> dbaron: What we'll end up with there is someone haveing a web-compat problem and have to go fix it<br>
&lt;fantasai> dbaron: If that impl can't implement it, then we have a bigger problem<br>
&lt;fantasai> myles_: Agreed<br>
&lt;fantasai> myles_: Part of this issue for me is relying on API that isn't clear what it's doing<br>
&lt;fantasai> drott: I see your point<br>
&lt;fantasai> drott: I would prefer a requirement as well<br>
&lt;fantasai> drott: Would be hopeful we can spec that<br>
&lt;fantasai> drott: Otherwise just widening allowances makes sense to me<br>
&lt;fantasai> dbaron: Maybe give Myles a chance to see what CoreText can do?<br>
&lt;fantasai> dbaron: We should care what platform APIs offer when we spec these things<br>
&lt;fantasai> myles_: Is CoreText the only API that's concerning here?<br>
&lt;fantasai> drott: I looked at FontConfig and DirectWrite and on Android looked at APIs<br>
&lt;fantasai> drott: On fontconfig and directwrite it's no problem<br>
&lt;dbaron> I don't know... jfkthame would probably be the person to ask for Mozilla expertise<br>
&lt;fantasai> drott: On Android I implemented an indexing method, so possible but might require own indexing<br>
&lt;fantasai> myles_: I would like to not parse font files myself<br>
&lt;fantasai> astearns: So I guess the proposed resolution is to find better/more ways to match fonts<br>
&lt;fantasai> astearns: and try to make requirements a MUST<br>
&lt;fantasai> astearns: but we don't have spec language for this<br>
&lt;gregwhitworth> fantasai: I agree with dbaron we need to see if myles_ can implement it<br>
&lt;fantasai> drott: Can we split the resolution? Can we match full name + postscript name<br>
&lt;fantasai> myles_: it's OK<br>
&lt;fantasai> astearns: So proposed to match on full font name and postscript name (MUST)<br>
&lt;fantasai> astearns: Any objections?<br>
&lt;fantasai> RESOLVED: local() matches against both full font name and postscript name<br>
&lt;fantasai> RESOLVED: Investigate whether it's practical to implement multi-locale name matching<br>
&lt;fantasai> astearns: Might also want to ask the i18nwg if they have any input on this<br>
&lt;heycam> fantasai: to what extent are there fonts that have one localization plus english, and someone else has a different localization plus english?<br>
&lt;heycam> fantasai: let's say you have a font that's released in Japan and France, and the French version has English and French names, not Japanese names<br>
&lt;heycam> ... and the Japanese versoin has Japanese name and English name, but not a French name<br>
&lt;heycam> ... I think it was there to handle situations like this<br>
&lt;heycam> ... if you force the author to use the English name it could work in more place<br>
&lt;heycam> ... it's possible this is not why it's there<br>
&lt;heycam> myles_: I've never heard of a font author doing that. usually they just make a font in a particular set of languages<br>
&lt;heycam> fantasai: just want to check if this has historically happened in the past<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3177#issuecomment-432131599 using your GitHub account

Received on Tuesday, 23 October 2018 07:39:58 UTC