Sidebar

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
update_all_kerning_pairs [2015/09/02 10:33]
johan
update_all_kerning_pairs [2015/09/02 13:06]
johan
Line 10: Line 10:
 tree = etree.parse('​FontWithKerning.bf'​) tree = etree.parse('​FontWithKerning.bf'​)
 for elem in tree.xpath("​.//​kerning"​):​ for elem in tree.xpath("​.//​kerning"​):​
-    ​= float (elem.attrib['​hadjustment'​])+    ​kerning ​= float (elem.attrib['​hadjustment'​])
     ​     ​
     # add 10 more units of space to each kerning pair     # add 10 more units of space to each kerning pair
-    elem.attrib['​hadjustment'​] = str (- 10)+    elem.attrib['​hadjustment'​] = str (kerning ​- 10)
  
 with open('​FontWithUpdatedKerning.bf',​ '​wb'​) as file_handle:​ with open('​FontWithUpdatedKerning.bf',​ '​wb'​) as file_handle:​