Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all families have regular:400 styles #20

Closed
mrbinky3000 opened this issue Apr 25, 2015 · 10 comments
Closed

Ensure all families have regular:400 styles #20

mrbinky3000 opened this issue Apr 25, 2015 · 10 comments

Comments

@mrbinky3000
Copy link

I'm not sure if this is the pace to report this or the webfont loader repo, or both.

There are several fonts hosted by google that do not work with FVD shorthand.

Off the nearly 700 fonts hosted by google (All of which accept the FVD syntax) only these font URL's resulted in 404's

GET https://fonts.googleapis.com/css?family=Buda:n3
GET https://fonts.googleapis.com/css?family=Coda+Caption:n8
GET https://fonts.googleapis.com/css?family=Open+Sans+Condensed:n3,i3,n7
GET https://fonts.googleapis.com/css?family=UnifrakturCook:n7

These do work with the older, more verbose syntax. For example:
GET https://fonts.googleapis.com/css?family=Buda:300

@rsheeter
Copy link
Collaborator

As this reproduces with Google Fonts without the webfont loader I'd say this is the right place. Thank you for the report.

@davelab6 davelab6 self-assigned this Apr 27, 2015
@davelab6 davelab6 changed the title Several Fonts don't work with FVD syntax. Ensure all families have regular:400 styles Apr 27, 2015
@davelab6
Copy link
Member

The Google Fonts API doesn't support the FVD syntax in any way, but it has a default response.

If you look at the contents of http://fonts.googleapis.com/css?family=Open+Sans:i5 then you see only the i4 is returned; anything without an i (http://fonts.googleapis.com/css?family=Open+Sans:whatever) returns the r4.

these font URL's resulted in 404's

They don't have regular:400 styles, and they ought to :) When a family only supports non 400 weights, the weight needs to be specified.

@mrbinky3000
Copy link
Author

@davelab6 and @rsheeter Thanks for looking into the 404 issue! I didn't notice that FVD just returned the n4 version of each font. Any chance that might get supported in the future?

@davelab6
Copy link
Member

My personal opinion is that any secondary CSS API syntax is unlikely to be supported, because it would mean reducing the maximal caching that comes with a single primary syntax. However, I'm personally curious to better understand your motivation for using the FVD syntax. Why is this syntax better? :)

@mrbinky3000
Copy link
Author

Unless I'm missing something, I don't think this would alter caching? Google responds with a css file that contains a @font-face definition which, in turn, contains src url's to the font. Calling https://fonts.googleapis.com/css?family=Buda:n3 shouldn't change what's declared in the CSS that I know of (but I really don't know how that random string used for the font src is generated)

FVD is just a nice format that I thought TypeKit and Google worked on together? It's supposed to be "A way to unambiguously, compactly and clearly describe a set of @font-face properties." But above all that, it's less characters and I'm a lazy typist. :-)

@rsheeter
Copy link
Collaborator

WRT caching, if you visit site 1 that uses family=Buda:n3 and site 2 that uses family=Buda:300 you would produce a cache miss for the CSS even if the font file got a cache hit. Accordingly, we do not currently intend to support FVD in the /css API (unless a presently unknown compelling reason emerges I suppose).

@davelab6
Copy link
Member

it's less characters and I'm a lazy typist

I can recommend tools like https://github.com/tekezo/Karabiner (mac) and https://github.com/AutoHotkey/AutoHotkey (windows) for helping with that :)

@mrbinky3000
Copy link
Author

Again, I don't think you're taking a caching hit. The CSS file returned by Google is only 4 lines of text per font returned. That's only about 200 bytes per font. That CSS file contains a src css attribute that points to another URL (like to a woff2 file). If that src URL is the same for FVD and non FVD, then the font is still cached. I don't know how that FVD url is generated though. Perhaps you would have better insight into that.

So, every call to a Google web font font results in two queries. The first is very tiny, the second contains the font file itself.

On another note: Karabiner looks cool :-)

@davelab6
Copy link
Member

I don't think you're taking a caching hit

I guess that it can seem odd to want to avoid losing the caching of the css :) I hope you'll find this more reasonable if you consider the scale of Google Fonts; at http://www.google.com/fonts#Analytics:total you can see that the single most popular family, Open Sans, has a CSS request served by Google Fonts API 17,789,030,914 times a week, or 2,541,290,131 times per day. So these very tiny pieces of CSS add up, and caching them is important for making web fonts as fast as possible :)

@davelab6
Copy link
Member

BTW, over in typekit/fvd#6 (comment) Bram says typekit is moving away from fvd.

thundernixon pushed a commit to thundernixon/fonts that referenced this issue Oct 16, 2018
* Added VerticalMetrics.md

A guide to setting vertical metrics for Google Fonts.

* Replaced Roman numerals with standard numerals

* Update info on Glyphs scripts
thundernixon pushed a commit to thundernixon/fonts that referenced this issue Jan 30, 2019
* Added VerticalMetrics.md

A guide to setting vertical metrics for Google Fonts.

* Replaced Roman numerals with standard numerals

* Update info on Glyphs scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants