Skip to content

Commit

Permalink
Merge pull request #81 from googlefonts/simoncozens-patch-1
Browse files Browse the repository at this point in the history
Improve usage for README
  • Loading branch information
m4rc1e authored Jul 28, 2023
2 parents 59dbf04 + 3555b95 commit 7b8c152
Showing 1 changed file with 55 additions and 19 deletions.
74 changes: 55 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,44 @@ In order to test fonts on the correct words, we first determine what scripts are

## Usage

Generate proofing docs for a family
`diffenator2` has two subcommands, `diff` and `proof`.

`diffenator2 proof font1.ttf font2.ttf font3.ttf -o out_dir`


Proof and include browser images

`diffenator2 proof font1.ttf font2.ttf font3.ttf -o out_dir --imgs`
### `diff`

```
usage: diffenator2 diff [-h] [--out OUT] [--imgs]
[--filter-styles FILTER_STYLES] [--pt-size PT_SIZE]
[--styles {instances,cross_product,masters}]
--fonts-before FONTS_BEFORE [FONTS_BEFORE ...]
--fonts-after FONTS_AFTER [FONTS_AFTER ...]
[--user-wordlist USER_WORDLIST] [--no-diffenator]
[--threshold THRESHOLD]
--out OUT, -o OUT Output dir
--imgs Generate images
--filter-styles FILTER_STYLES
--pt-size PT_SIZE, -pt PT_SIZE
--styles {instances,cross_product,masters}, -s {instances,cross_product,masters}
Show font instances, cross product or master styles
--fonts-before FONTS_BEFORE [FONTS_BEFORE ...], -fb FONTS_BEFORE [FONTS_BEFORE ...]
--fonts-after FONTS_AFTER [FONTS_AFTER ...], -fa FONTS_AFTER [FONTS_AFTER ...]
--user-wordlist USER_WORDLIST
--no-diffenator
--threshold THRESHOLD, -t THRESHOLD
```

Compare two font families
* The most typical usage is to compare two font families:

```
# -fb == --fonts-before, -fa == --fonts-after
diffenator2 diff -fb font1.ttf -fa font2.ttf -o out_dir
```


Compare two font families and include a custom wordlist
* Compare two font families and include a custom wordlist

`diffenator2 diff -fb font1.ttf -fa font2.ttf --user-wordlist wordlist.txt -o out_dir`

A wordlist is basically a csv file with the following columns.
A wordlist is a csv file with the following columns:

`string, script, lang, ot features...`

Expand All @@ -75,26 +90,47 @@ a,latn,dflt,ss01
0123456789,,,numr,tnum
```

Only diff regular and bold styles
* The `--filter-styles` option can be used to select which styles should be compared

`diffenator2 diff -fb font1.ttf -fa font2.ttf --filter-styles "Regular|Bold"`
For example, to only diff regular and bold styles:

`diffenator2 diff -fb font1.ttf -fa font2.ttf --filter-styles "Regular|Bold"`

--filter-styles accept wildcards so let's diff all Bold styles
`--filter-styles` also accepts wildcards. To diff all Bold styles:

`diffenator2 diff -fb font1.ttf -fa font2.ttf --filter-styles "Bold*"`

* `-s` is used to choose which locations of a variable font should be compared

Compare variable font masters
The default is to compare named instances. To only compare masters:

`diffenator2 diff -fb font1.ttf -fa font2.ttf -s masters`


Compare variable fonts axes using a cross product
To compare the cross product of min/default/max for each axis:

`diffenator2 diff -fb font1.ttf -fa font2.ttf -s cross_product`

* `-ch` is used to select which characters to compare

Compare only ascii characters
To compare only ascii characters:

`diffenator2 diff -fb font2.ttf -fa font2.ttf -ch "[!-~]"`

### `proof`

```
usage: diffenator2 proof [-h] [--out OUT] [--imgs]
[--filter-styles FILTER_STYLES] [--pt-size PT_SIZE]
[--styles {instances,cross_product,masters}]
fonts [fonts ...]
```

* Generate proofing docs for a family

`diffenator2 proof font1.ttf font2.ttf font3.ttf -o out_dir`

* Proof and include browser images

`diffenator2 proof font1.ttf font2.ttf font3.ttf -o out_dir --imgs`

`diffenator2 diff -fb font2.ttf -fa font2.ttf -ch "[!-~]"`
* `--filter-styles` and `--styles` operate as above

0 comments on commit 7b8c152

Please sign in to comment.