Test fonts using diffenator2.
- uses: f-actions/diffenator2@mainwith:
# Personal access token (PAT). This is required in order to download# fonts from upstream font projects. Use ${{ secrets.GITHUB_TOKEN }}# Required: Truegithub-token: ''# Path to fonts which need to be tested. Wildcards are possible e.g# `fonts/variable/*.ttf`# Required: Truepath: ''# Method to fetch older fonts for comparison. Choose from# 'googlefonts' or 'github-release'.# Required: Falsefetch-before: ''# The 'username/repo' string if fetch-before is set to 'github-release'# e.g `googlefonts/gulzar`.# Required: Falserepo: ''# Font path to older fonts to compare against e.g `fonts_before/*.ttf.# Required: Falsepath-before: ''# Output directory# Default: test_results# Required: Falseout: ''# Run diffenator# Default: Falserun-diffenator: bool# Run diffbrowsers# Default: Falserun-diffbrowsers: bool# Path to a user wordlist# Required: Falseuser-wordlist: ''# Only test the following styles. Regex strings accepted e.g "Regular|Bold|.*Italic"# Required: Falsefilter-styles: ''# Set font point size for diffbrowsers# Required Falsept-size: int# Show changes over this percentage of changed pixels# Required: False (default 0.9)threshold: floatRun proofing tools:
on: [push]jobs:
font-render:
runs-on: ubuntu-latestname: Check fonts on different browserssteps:
- uses: actions/checkout@v2
- uses: f-actions/diffenator2@mainwith:
github-token: ${{ secrets.GITHUB_TOKEN }}path: "./fonts/*.ttf"Diff fonts against Google Fonts:
on: [push]jobs:
font-render:
runs-on: ubuntu-latestname: Check fonts on different browserssteps:
- uses: actions/checkout@v2
- uses: f-actions/diffenator2@mainwith:
github-token: ${{ secrets.GITHUB_TOKEN }}path: "./fonts/*.ttf"fetch-before: "googlefonts"path-before: "*.ttf"run-diffenator: truerun-diffbrowsers: trueDiff fonts against a latest upstream release but only test Regular and Italic:
on: [push]jobs:
font-render:
runs-on: ubuntu-latestname: Check fonts on different browserssteps:
- uses: actions/checkout@v2
- uses: f-actions/diffenator2@mainwith:
github-token: ${{ secrets.GITHUB_TOKEN }}path: "./gulzar/fonts/*.ttf"fetch-before: "github-release"repo: "googlefonts/gulzar"path-before: "*.ttf"run-diffenator: truerun-diffbrowsers: truefilter-styles: "Regular|Italic"Generating screenshots on Mac, Win and Linux with a 14pt font size
name: Test screenshotson:
push:
branches: [main]jobs:
screenshot:
runs-on: ${{ matrix.os }}strategy:
matrix:
python-version: [3.9]os: [ubuntu-latest, windows-latest, macos-latest]steps:
- uses: actions/checkout@v2with:
submodules: recursivefetch-depth: 0
- uses: f-actions/diffenator2@mainwith:
github-token: ${{ secrets.GITHUB_TOKEN }}paths: "./fonts"fonts_before: "googlefonts"run-diffenator: falserun-diffbrowsers: truept-size: 14For a complete project see https://github.com/m4rc1e/mavenproFont/blob/main/.github/workflows/build.yaml. This project will first build the fonts and then compare them against the latest release on Google Fonts. It uses a platform matrix to render browser screenshots for Win, Mac and Linux. It also runs diffenator on the latest Linux as a seperate job. This setup should be suitable for most font projects.