googlefonts / gfregression Goto Github PK
View Code? Open in Web Editor NEWTest local fonts against fonts host on fonts.google.com
License: Apache License 2.0
Test local fonts against fonts host on fonts.google.com
License: Apache License 2.0
@m4rc1e the vertical shift in the images in google/fonts#605 (comment) means the toggle is kinda useless
http://35.238.63.0/ is broken.
This prevents local runs that are independent of Google Fonts.
It is useful to compare not only against a same-named family in GF API, but also against a 2nd dropped family.
Hinting might have changed just for some sizes, so it would be useful to give the user a size selector.
In this PR, Dave suggested adding a Heavy 1000 weight, but after adding this to the source file, the Travis CI build failed with the following error:
INFO:__main__:Running Diffbrowsers
INFO:diffbrowsers.gfregression:Posting fonts to GF Regression
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 534, in <module>
main()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 511, in main
qa.googlefonts_upgrade()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 270, in googlefonts_upgrade
self.diffbrowsers()
File "/home/travis/virtualenv/python3.7.1/bin/gftools-qa.py", line 193, in diffbrowsers
diff_browsers.new_session(set(fonts_before), set(fonts_after))
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/diffbrowsers/diffbrowsers.py", line 55, in new_session
self.gf_regression.new_session(fonts_before, fonts_after)
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/diffbrowsers/gfregression.py", line 55, in new_session
self.info = request.json()
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/simplejson/__init__.py", line 525, in loads
return _default_decoder.decode(s)
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The command "bash .ci/run.sh" exited with 1.
Done. Your build exited with 1.
After talking with @m4rc1e, it seems this might be a GFR issue and not a problem with Diffbrowsers, so I am creating an issue here, but please close this and move it to Diffbrowsers if I am mistaken.
In light of #15. Users should be presented with an error page which contains the exception, if the application crashes.
"Comparing two sets of local fonts" on http://45.55.138.144/, dragging in two fonts and clicking upload makes the site hang...
Looks like we need it sooner rather than later, google/fonts#670
I'll try and get a rough implementation going this week.
In the vein of https://github.com/impallari/Font-Testing-Page.
I assumed the first drop zone is the "before" font and the second the "after" font. It's actually switched.
Maybe make the drop zones horizontal and name them explicitly, like:
[ Before ] => [ After ]
For a quick check to see if something changed, one doesn't need a database.
https://github.com/niklasvh/html2canvas could be integrated to make it easy to generate a GIF for inclusion in a deck/pdf
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?
If a user attempts to diff a variable font in a browser which lacks support, the variable font's default weight will be visible. This could cause confusion.
We could go even further and avoid displaying the VF diffs in older browsers.
Maybe even make them top-level menu entries like the before/after switcher, like:
Google Fonts Regression | New glyphs (2) Changed glyphs (5) Missing glyphs (1) [ Before/after ] [ Tools dropdown ]
You know you want to.
Now that this tool uses the diffenator as its core diff library, I propose to reduce confusion by renaming this web UI to "diffenator-web"
Following https://github.com/m4rc1e/gfregression/issues/7 it may be useful to have a comparison of 3 families.
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
Its now getting to the point where writing functional tests using Selenium would greatly help.
Running gfregression
locally can be slow for me. For example, switching from Marks New
to Marks Missing
can take a few minutes or more. Is there anything that can be done to speed up the tests? Is this something other people have noticed?
cc @davelab6
Hey @m4rc1e , I am trying the live version you have on the web. I wonder if the files cache somehow because I uploaded a font, made some changes, and then uploaded again, but my changes aren't there.
Here's the first, here's the second.
I am going to diff the cached files and see what I can learn.
Thin and ExtraLight key values appear to need updating to 100 and 200.
Trying to start a VM with this and navigating to it fails with a 502, bad gateway. The logs say:
web_1 | 2019-01-29 10:50:32,363 INFO spawned: 'uwsgi' with pid 10
web_1 | realpath() of /app/uwsgi.ini failed: No such file or directory [core/utils.c line 3651]
web_1 | 2019-01-29 10:50:32,383 INFO exited: uwsgi (exit status 1; not expected)
Family can upload but it uses fallback fonts. I suspect it involves the class name being "Exo 2", css interprets this as two separate classes. I should make it "Exo-2"
From email,
The tool only looks at encoded glyphs.
I think its important to check unencoded glyphs for regressions too...
It would be useful to see the numerical information regarding vertical metric values as well.
In RobotoVF, the font Roboto-VF.ttf contains no instances in the fvar table.
>>> from fontTools.ttLib import TTFont
>>> f = TTFont('/Users/marc/Downloads/Roboto-VF.ttf')
>>> f['fvar'].instances
[]
fvar instances are used in GFR to generate css classes.
cc @laerm0
Like discussed in this PR google/fonts#2561, diffbrowser previews is testing fonts on an old version of Safari where there is still this HVAR issue that makes the spacing wiggling for glyphs made of components in variable fonts.
The bug is fixed in Catalina. Maybe we could update also the preview to a version of safari where variable fonts are displayed correctly ?
This app runs on a tiny Digital Ocean droplet. Because of this constraint the DB and app are inside the same container. This is bad because if we rebuild the container, we lose all the data.
Since We have a few open prs in fonts/google which must remain intact. I cannot rebuild the containers just yet. Once the prs have been merged. I'll work on giving the db its own container. This means we can rebuild the webapp without destroying any existing comparisons.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.