googlefonts / gfregression

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

"Exception: Family I B M Plex Sans does not exist on Google Fonts!" #45

Open thundernixon opened 5 years ago

thundernixon commented 5 years ago

When I try to diff IBM Plex Sans Bold, I get the following error:

500 error
Submit following traceback to the GF Regression repo

Traceback (most recent call last): 
File "/usr/local/lib/python3.7/site-packages/flask/app.py", 
    line 2292, in wsgi_app response = self.full_dispatch_request() 
File "/usr/local/lib/python3.7/site-packages/flask/app.py", 
    line 1815, in full_dispatch_request rv = self.handle_user_exception(e) 
File "/usr/local/lib/python3.7/site-packages/flask/app.py", 
    line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) 
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", 
    line 35, in reraise raise value 
File "/usr/local/lib/python3.7/site-packages/flask/app.py", 
    line 1813, in full_dispatch_request rv = self.dispatch_request() 
File "/usr/local/lib/python3.7/site-packages/flask/app.py", 
    line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) 
File "./main.py", 
    line 67, in upload_fonts family_before = family.from_googlefonts(family_after.name) 
File "./family.py", 
    line 239, in from_googlefonts fonts = downloadfonts.googlefonts(family_name) 
File "./downloadfonts.py", 
    line 24, in googlefonts raise Exception('Family {} does not exist on Google Fonts!'.format(family)) Exception: Family I B M Plex Sans does not exist on Google Fonts!

Is the I B M supposed to have spaces in it here, or could this be a relatively simple name-parsing / string-manipulation issue?

thundernixon commented 5 years ago

(error reformatted in top comment for more readability)

m4rc1e commented 5 years ago

or could this be a relatively simple name-parsing / string-manipulation issue?

Yep, we have a similar issue with add-font. The family name is derived from the filename, using a camelcase splitting function. When it encounters IBM it will produce I B M. In order not to split, we add it to https://github.com/googlefonts/gfregression/blob/master/app/utils.py#L19-L60