Okay, I built libfreetype from their git repo, installed it to /usr/local and reran my test:
$ LD_LIBRARY_PATH=/usr/local/lib/ python testcase.py
freefont-20090104-FreeMono.ttf at pixel size 16, advances:
10 for 95 characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
freefont-20090104-FreeMono.ttf at pixel size 100, advances:
60 for 95 characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
freefont-20090104-FreeMono.ttf at pixel size 200, advances:
120 for 95 characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
freefont-20090104-FreeMono.ttf at pixel size 300, advances:
180 for 95 characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
freefont-20100919-FreeMono.ttf at pixel size 16, advances:
9 for 23 characters: #*+;IJPSTUY[]deilmq{|}~
10 for 71 characters: !"$%&'(),-./0123456789:<=>?@ABCDEFGHKLMNOQRVWXZ\^_`abcfghjknoprtuvwxyz
11 for 1 characters: s
freefont-20100919-FreeMono.ttf at pixel size 100, advances:
59 for 11 characters: $?IS^fjrsuz
60 for 80 characters: !"#&'()*+,-/0123456789;<=>@ABCDEFGJKLMNOPQRTUVWXYZ[\]_`abcdeghiklmnopqtvwxy{|}~
61 for 4 characters: %.:H
freefont-20100919-FreeMono.ttf at pixel size 200, advances:
120 for 71 characters: !"%&'(),.0123456789:;<=>@ABCDEFHJMNPRTUVWXYZ[]_`abcdefhjkmopqrtuvwyz{|
121 for 13 characters: $*/?GIKL\^gns
119 for 11 characters: #+-OQSilx}~
freefont-20100919-FreeMono.ttf at pixel size 300, advances:
179 for 4 characters: =]xy
180 for 77 characters: !"$&'()*,./0123456789:;<>?@BCDEFGIJKLMNOPQRUVWXYZ[\^_`abcdefghkmnqrstuvwz{|}
181 for 14 characters: #%+-AHSTijlop~
This does indeed show what Sam observed: the two versions of FreeMono.ttf show different advances for some characters. So the weird behaviour only materializes with a recent version of FreeType and a specific version of FreeMono.ttf. Does that help us figure out what's happening and whether there's actually a bug somewhere?
Okay, I built libfreetype from their git repo, installed it to /usr/local and reran my test:
$ LD_LIBRARY_ PATH=/usr/ local/lib/ python testcase.py 20090104- FreeMono. ttf at pixel size 16, advances: ()*+,-. /0123456789: ;<=>?@ABCDEFGHI JKLMNOPQRSTUVWX YZ[\]^_ `abcdefghijklmn opqrstuvwxyz{ |}~
freefont-
10 for 95 characters: !"#$%&'
freefont- 20090104- FreeMono. ttf at pixel size 100, advances: ()*+,-. /0123456789: ;<=>?@ABCDEFGHI JKLMNOPQRSTUVWX YZ[\]^_ `abcdefghijklmn opqrstuvwxyz{ |}~
60 for 95 characters: !"#$%&'
freefont- 20090104- FreeMono. ttf at pixel size 200, advances: ()*+,-. /0123456789: ;<=>?@ABCDEFGHI JKLMNOPQRSTUVWX YZ[\]^_ `abcdefghijklmn opqrstuvwxyz{ |}~
120 for 95 characters: !"#$%&'
freefont- 20090104- FreeMono. ttf at pixel size 300, advances: ()*+,-. /0123456789: ;<=>?@ABCDEFGHI JKLMNOPQRSTUVWX YZ[\]^_ `abcdefghijklmn opqrstuvwxyz{ |}~
180 for 95 characters: !"#$%&'
freefont- 20100919- FreeMono. ttf at pixel size 16, advances: ]deilmq{ |}~ ),-./0123456789 :<=>?@ABCDEFGHK LMNOQRVWXZ\ ^_`abcfghjknopr tuvwxyz
9 for 23 characters: #*+;IJPSTUY[
10 for 71 characters: !"$%&'(
11 for 1 characters: s
freefont- 20100919- FreeMono. ttf at pixel size 100, advances: *+,-/0123456789 ;<=>@ABCDEFGJKL MNOPQRTUVWXYZ[ \]_`abcdeghiklm nopqtvwxy{ |}~
59 for 11 characters: $?IS^fjrsuz
60 for 80 characters: !"#&'()
61 for 4 characters: %.:H
freefont- 20100919- FreeMono. ttf at pixel size 200, advances: ,.0123456789: ;<=>@ABCDEFHJMN PRTUVWXYZ[ ]_`abcdefhjkmop qrtuvwyz{ |
120 for 71 characters: !"%&'()
121 for 13 characters: $*/?GIKL\^gns
119 for 11 characters: #+-OQSilx}~
freefont- 20100919- FreeMono. ttf at pixel size 300, advances: *,./0123456789: ;<>?@BCDEFGIJKL MNOPQRUVWXYZ[ \^_`abcdefghkmn qrstuvwz{ |}
179 for 4 characters: =]xy
180 for 77 characters: !"$&'()
181 for 14 characters: #%+-AHSTijlop~
This does indeed show what Sam observed: the two versions of FreeMono.ttf show different advances for some characters. So the weird behaviour only materializes with a recent version of FreeType and a specific version of FreeMono.ttf. Does that help us figure out what's happening and whether there's actually a bug somewhere?