After seeing Roel Nieskens's Sans Bullshit Sans font, I wanted to grab a list of all the words or phrases that were included in the GSUB table for something I was working on (relating to JobMine and buzzword metrics). Sans Bullshit Sans uses the GSUB table to tell the font which letter combinations rules to replace with their custom ligatures.
None of the tools I found after a quick search seemed to allow me to dump all the strings that the GSUB table defined for replacements, so I wrote this simple Python script to traverse the TTX output (which is simply a valid XML file, at least according to xmllint
) and print out the ligature substitutions that the font uses. It grabs each LigatureSet
(which corresponds to the first character), and then the remaining characters are in the children Ligature
tags.
The script takes input from stdin
, and output is sent to stdout
.
python bs-sans.py < SansBullshitSans.ttx > words.txt
Can you also make a script that actually add ligatures into a "clean font"? Would like something fun like that.