Is it possible to specify a font version in the google fonts api?

1.1k views Asked by At

A Google font we use (Pacifico) recently had a rather radical redesign to the capital 'L'. As we use this for our product with a name begging with 'L' this caused a rather radical change in the look to our product.

Digging into it, I noticed that the url for the fonts had changed from

fonts.gstatic.com/s/pacifico/v7/Q_Z9mv4hySLTMoMjnk_rCXYhjbSpvc47ee6xR_80Hnw.woff2

to

fonts.gstatic.com/s/pacifico/v8/Q_Z9mv4hySLTMoMjnk_rCXYhjbSpvc47ee6xR_80Hnw.woff2

but that the previous v7 urls still worked. So, for now, I have added hardcoded font references to that version.

Is it possible, though, to instead link to a particular version of a font?

<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>

So, somehow specify a version in the above link?

I have tried various guesses, such as:

https://fonts.googleapis.com/css?family=Pacifico&version=7
https://fonts.googleapis.com/css?family=Pacifico&version=v7
https://fonts.googleapis.com/css?family=Pacifico:v7

but to no avail.

1

There are 1 answers

0
Jacktose On BEST ANSWER

The recommended way to stick with a particular version is to self-host it.

Google does not and will not have a versioning option.
The API v7 hack you're using is officially not recommended, and may break.

A Google Fonts employee “davelab6” has been responding to several questions like yours on the Google Fonts github. This question is much like yours and has a brief answer from him. It also links to several other issues with spirited discussion about a similar change.
The upshot is that Google has considered offering a versioning feature and rejected it for several reasons. They say the vast majority of users will be fine with the latest version of a font, and the rest can self-host the version they like.

As for how to self-host, I'm out of my depth, but there's a question about it here with several answers.