Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
behdad committed Nov 10, 2023
1 parent 7bfd03c commit 63f3c4c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 51 deletions.
67 changes: 16 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,13 @@ $ python3 kern_pair.py FontFile.ttf PairString
## Example

```
$ python3 kern_pair.py Roboto-Regular.ttf --dict /usr/share/dict/words
$ python3 kern_pair.py Roboto-Regular.ttf --dict /usr/share/dict/words -l
fi 0 -4
lt 4 0
rb 4 0
rk 4 0
dy 4 0
rh 4 0
yb 4 0
dv 4 0
Ti -4 0
dt 5 0
yh 4 0
Ap 4 0
Ly -1 -6
kp 4 0
ET -3 1
PA -3 -7
RT 0 -4
FA -3 -8
Ut 4 0
kj 6 0
LT -9 -13
IX -3 1
Aj 5 0
GT -4 0
Mt 4 0
Lj 4 0
YU -1 -5
Ht 4 0
Kj 6 0
hT -7 0
TJ -7 -12
cT -6 0
vb 4 0
rZ -5 0
oT -8 0
vh 4 0
Jt 4 0
Kp 4 -1
FJ -9 -13
Rj 4 0
HX -3 1
VJ -5 0
yt 4 0
Te -9 -5
To -9 -5
TA -8 -4
DT -5 -1
```

The first value is the pair of letter to kern. The second value is, in percent
Expand All @@ -76,23 +40,24 @@ The `-l` or `--letters-only` makes the tool only consider kerning between
two letters (ie. no punctuation). The tool also ignores digits, since they
typically have a fixed width and no kerning by design.

To inspect the pairs reported, you can use the `kern_pair.py` tool:
A file `kerned.pdf` is always generated, with each page showcasing one pair
the tool thinks would need adjustment: [kerned.pdf](/images/kerned.pdf)

To inspect the pairs reported, you can use the `kern_pair.py` tool again:
```
$ python3 kern_pair.py Roboto-Regular.ttf LT
LT autokern: -9 (-184 units) existing kern: -13 (-275 units)
Saving kern.png and kerned.png
$ python3 kern_pair.py Roboto-Regular.ttf To
To autokern: -9 (-184 units) existing kern: -5 (-99 units)
Saving kern.png
```
In this case the tool thinks the pair "LT" is over-kerned in Roboto.
In this case the tool thinks the pair "To" is not kerned enough in Roboto.
Obviously that's up to taste. But here's the two files `kern.png`
and `kerned.png` generated by the tool:
and `kerned.pdf` generated by the tool:

![kern.png](/images/kern.png)

![kerned.png](/images/kerned.png)

In the `kern.png` image, the first line is with no kerning. The second line
is the tool's suggestion, and the third line is the existing font
kerning. The `kerned.png`, the pair is showcased between lower, and upper,
kerning. The `kerned.pdf`, the pair is showcased between lower, and upper,
letters. The three rows, similarly, show no-kerning, tool's suggestion,
and existing kern.

Expand Down
Binary file modified images/kern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/kerned.pdf
Binary file not shown.
Binary file removed images/kerned.png
Binary file not shown.

0 comments on commit 63f3c4c

Please sign in to comment.