GithubHelp home page GithubHelp logo

Comments (10)

rsheeter avatar rsheeter commented on July 20, 2024

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

from fonts.

davelab6 avatar davelab6 commented on July 20, 2024

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.

from fonts.

mrbinky3000 avatar mrbinky3000 commented on July 20, 2024

@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?

from fonts.

davelab6 avatar davelab6 commented on July 20, 2024

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? :)

from fonts.

mrbinky3000 avatar mrbinky3000 commented on July 20, 2024

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. :-)

from fonts.

rsheeter avatar rsheeter commented on July 20, 2024

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).

from fonts.

davelab6 avatar davelab6 commented on July 20, 2024

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 :)

from fonts.

mrbinky3000 avatar mrbinky3000 commented on July 20, 2024

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 :-)

from fonts.

davelab6 avatar davelab6 commented on July 20, 2024

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 :)

from fonts.

davelab6 avatar davelab6 commented on July 20, 2024

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

from fonts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.