Search


Sidebar

This is an old revision of the document!


Warning: Declaration of syntax_plugin_flowplay2::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /customers/7/6/d/birdfont.org/httpd.www/doku/lib/plugins/flowplay2/syntax.php on line 66 Warning: Declaration of syntax_plugin_flowplay2::render($mode, &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /customers/7/6/d/birdfont.org/httpd.www/doku/lib/plugins/flowplay2/syntax.php on line 114

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.

update_kerning.py
#!/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.

Make a backup of your font before you run this scripts!