googlefonts / gfregression

Test local fonts against fonts host on fonts.google.com
Apache License 2.0
14 stars 10 forks source link

Allow testing non-catalog fonts #38

Open davelab6 opened 6 years ago

davelab6 commented 6 years ago

There are some fonts available from fonts.googleapis.com/css?family=FAMILY but not from https://fonts.google.com/download?family=FAMILY (which is only for font available from https://fonts.google.com/specimen/FAMILY)

GFR should be updated with an try/except or if/else so that when download?family=FAMILY fails it double checks css?family=FAMILY&subset=ALL using a blank user agent string in the HTTP GET request, to obtain the URLs of TTFs from gstatic.com

m4rc1e commented 6 years ago

Thanks for filing this.

I'm curious if fonts.googleapis.com/css?family=FAMILY and https://fonts.google.com/download?family=FAMILY are in sync?

We had this issue filed to google/fonts recently, https://github.com/google/fonts/issues/1679

davelab6 commented 6 years ago

1679 was a bug, can be ignored.

They are in sync if the latter is available.

m4rc1e commented 6 years ago

I just realised we may not be use the api endpoint. This endpoint is for web fonts. I think they've all had some form of post processing (removed OT features etc). I'll need to test this first.

davelab6 commented 6 years ago

SUBSET=ALL should help reduce the delta.

m4rc1e commented 6 years ago

Yeah I'll download a font with curl/wget so I get the unsubsetted fonts. I'll then diff it against the downloadable versions from the gf site.

m4rc1e commented 6 years ago

I just downloaded a font using wget from the css endpoint and diffed it against the downloadable family on fonts.google.com. Unfortunately, they're very different. Api fonts lack most of the OT features. I think they're still being run through pyftsubset which is then stripping out these features.

screen shot 2018-09-17 at 14 03 01