Test two sets of fonts for visual regressions on different browsers.
Output gif of Roboto compared against the version on Google Fonts. Win7 ie11
Important: This tool uses the Browserstack screenshots api. You must have a subscription in order to use this.
For non developers:
pip install gfdiffbrowsers
For developers
$ git clone https://github.com/googlefonts/diffbrowsers
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ pip install . (-e for developer mode)
Auth
Create a file ~/.browserstack-api-config containing the following data:
[Credentials]
username = <your BrowserStack Username>
access_key = <your BrowserStack Access Key>
This information can be found in https://www.browserstack.com/accounts/settings
Important: Font names must match between the two sets.
Produce a waterfall
gfdiffbrowsers new [fonts_after] -fb [fonts_before] -o ~/Desktop/font_img
Produce a glyph palette containing all glyphs at 20pt, export gifs as well
gfdiffbrowsers new [fonts_after] -fb [fonts_before] -o ~/Desktop/font_img -v glyphs-all -gif -pt 20
Compare a set of fonts against the same families hosted on Google Fonts
gfdiffbrowsers new [fonts_after] -gf -o ~/Desktop/font_img
Load an existing session
gfdiffbrowsers load <url> -o ~/Desktop/font_img
Make sure you have a local copy of GF Regression running and you also have browserstack enabled to run locally. Simply add the following.
--gfr-url http://localhost-gfr-url
|-u http://gfr-localhost-url
and --gfr-local
|-l
e.g
gfdiffbrowsers new /path/to/font.ttf -gf -u http://127.0.0.1:5000 -l -o ~/Desktop/fontIMG
Browserstack's screenshot api isn't fast. Please be patient.
If you cancel midway through a font comparison, BrowserStack may still be running. There is also no way to terminate the BrowserStack process remotely. Since most users will only have a 1 user license, users must wait for BrowserStack to finish before running again.
Sometimes BrowserStack will timeout when trying to generate a screenshot. If this happens, it will timeout gracefully, skip the screenshot and get the next browser. Unfortunately, this stability issue makes BrowserStack questionable for CI purposes. hopefully this will improve in the future.