-
Notifications
You must be signed in to change notification settings - Fork 4
Identify fonts by name instead of URL #8
Comments
For matching purpose, I'd expect the matching of At least in Firefox on Linux, both the user-facing name of the font (e.g. 'Fira Sans Light Italic') and the PostScript name (e.g. 'FiraSans-LightItalic') works, so a site could specify either. (Google Fonts specifies both.) I don't know how exactly the user-facing name is formed from TrueType/OpenType fields. In particular, I'm not at all sure matching on the user-facing name works for fonts with multiple natural-language forms of user-facing name. CC @jfkthame For tallying what's popular,
However, collapsing the user-facing name(s) and PostScript name to one counter might be best done by examining a corpus of known fonts that are licensing-wise suitable candidates for being browser-managed fonts. (The above should not, at least at this time, be taken as an endorsement of the general idea of having the browser eagerly populate a cross-site-available font cache.) |
Regarding
and moreover that
Current browsers vary in how accurately they implement this, IIRC. I think I've seen cases where some UAs match font family names in |
If "popular" (whatever that's determined to mean) web fonts are to be cached for cross-site use, identified by Suppose we were to include Zapfino in the set of "aggressively-cachable" fonts, and then the first site the user visits happens to have CSS that says
This will result (for users who don't have Zapfino installed locally) in the site's substitute font being cached as "Zapfino" and used everywhere thereafter. |
Another failure mode would be if the first version encountered for a given "popular" font name happens to be a subsetted resource, which is then cached as the "canonical" resource the browser will use for that name. Are we envisaging that the canonical list of "popular" web fonts would come with some kind of metadata -- SHA256 checksums or whatever -- for each corresponding resource, so that the browser can know whether what it has just fetched is the correct, canonical resource that should be cached? If they're not coming from a centralized source -- which I agree has its own issues -- then ISTM some such mechanism will be needed to assure correctness/integrity. |
I think there's only a little risk now but more risk over time. To avoid the browser caching totally bogus fonts, the set of fonts from which the popular subset is chosen for eager caching would need to be vetted for licensing. (I was assuming that for Chrome the vetted repository would be the Google Fonts set of original fonts that Google Fonts builds its subset fonts from.) So there wouldn't be a risk of getting a garbage font. The risk would be limited to getting a wrong font from the repository. Right now, if a site specifies a different font (as in different design) in A more realistic case than Zapfino would be Montressat, which Fedora bundles, which is the fourth family in the most popular ranking of Google Fonts, and would licensing-wise be obviously eligible for eager caching if browsers had a license-vetted set of candidate fonts. Do we really need to care if a designer did:
...and then ended up getting Montserrat on all systems? I think we don't need to treat that as breakage that we need to avoid. So I think right now, Once browsers block user-installed fonts by default, things get more complicated. So once browsers block user-installed fonts, malicious poisoning of the |
For this reason, I think it's not feasible to automatically takes files from the Web and expose them to different sites, but browsers would have pull the eagerly-cached fonts from a vetted repository of unsubsetted appropriately-licensed fonts. |
For sites like mine, this poses the risk that if the original font looks bad with the Microsoft rasterizer and I've taken steps to make the copy my site serves look better with the Microsoft rasterizer, if I specify |
That wasn't my concern, but rather that a site's alternative fallback would potentially "poison" the cache such that other sites that use Because of this, it seems that the eagerly-cached fonts have to come from a vetted repository (i.e. centralization, which I'm not sure is good). Unless we maintain a list of the vetted resources and their checksums, in which case perhaps the browser could safely add them to its cross-site cache regardless of where it first encounters them? |
A browser vendor vetting a repository of fonts that are eligible of being treated as popular is a form of centralization, but it's not the kind of tracking-enabling centralization as sites pointing to a central CDN themselves. It's more like CRLite. (But again, my opinion above is how I'd do the eager caching with minimally-bad incentives if eager caching is to be done, and I'm not saying that eager caching should be done.) |
Identifying fonts just by name is a little scary because there are a gazillion different versions of popular fonts, and many of them are busted in a variety of ways. |
In #3 (comment), @hsivonen suggested the interesting idea of identifying popular fonts by their names instead of by their URLs, to reduce the incentive to centrally host fonts.
@hsivonen, are you thinking of pulling the font's name out of the
font-family
descriptor or the font's name table or from somewhere else?The text was updated successfully, but these errors were encountered: