|
From: Khaled H. <kha...@eg...> - 2011-11-09 16:23:24
|
On Wed, Nov 09, 2011 at 06:15:15PM +0200, Khaled Hosny wrote: > On Wed, Nov 09, 2011 at 01:49:56PM -0200, Dimitre Lima wrote: > > It would be amazing to be able to use "Metrics -> Center in Width" feature in > > FontForge Python. > > I think it shouldn't be hard to do the needed calculation in Python, > something like: > > glyph = fontforge.activeFont()['a'] > xmin,ymin,xmax,ymax = glyph.boundingBox() > bwidth = xmax-xmin > glyph.left_side_bearing = glyph.right_side_bearing = (glyph.width-bwidth)/2 Seeing Max Rabkin's answer makes me wounder why I'm calculating the old side bearing myself, stupid :p Regards, Khaled |