googlefonts / gfregression

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

Hangs indefinitely when uploading 2 local fonts #15

Closed madig closed 6 years ago

madig commented 6 years ago

"Comparing two sets of local fonts" on http://45.55.138.144/, dragging in two fonts and clicking upload makes the site hang...

m4rc1e commented 6 years ago

@madig mind emailing me the fonts?

madig commented 6 years ago

Any fonts I tested. Try e.g. https://sourceforge.net/projects/dejavu/files/dejavu/2.36/dejavu-sans-ttf-2.36.zip/download and https://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-sans-ttf-2.37.zip/download

m4rc1e commented 6 years ago

@madig thanks!

We've been using it on much smaller sets of fonts. I'll see what's happening.

m4rc1e commented 6 years ago

Alright found the issue with Dejavu

fonts_after = models.add_fonts(after, 'after', uuid)
  File "/Users/marc/Documents/gfregression/app/models.py", line 39, in add_fonts
    fonts.append(add_font(path, font_type, uuid))
  File "/Users/marc/Documents/gfregression/app/models.py", line 47, in add_font
    family_name, style = filename[:-4].split('-')

The filename didn't follow the pattern I was expecting which is FamilyName-StyleName.ttf. For Dejavu, the filename is DejaVuSans.ttf.

At GF, font filenames must mention the style. For everyone else this isn't a deal breaker so I'll modify this now.

In the meantime, if you're curious to have a look around, rename your font to DejaVuSans-Regular.ttf

I will also include better error handling so when tracebacks occur, you'll see errors on a dedicated page.