Scripting


BirdFont does not include scripting capabilities in the GUI but all BF files are in XML format and you can edit them with python scripts. Here is an example of how to add 10 more units of spacing to each kerning pair in your font.


#!/usr/bin/python3

from lxml import etree

tree = etree.parse('FontWithKerning.bf')
for elem in tree.xpath(".//kerning"):
kerning = float (elem.attrib['hadjustment'])

# add 10 more units of space to each kerning pair
elem.attrib['hadjustment'] = str (kerning + 10)

with open('FontWithUpdatedKerning.bf', 'wb') as file_handle:
file_handle.write(etree.tostring(tree, pretty_print=True, encoding='utf8'))


Put this file in your font folder and replace FontWithKerning with the file name of your BF font.

**Create a backup of your font before you run this scripts!**