FontForge and Python
well, i've been asked to create some demonstrations of the use of python with
fontforge - not just "little scripts" but entire dialog boxes which will do the
same job as the existing menu options. ultimately, the goal is to replace
every single menu option with an equivalent. ok - the goal is for me to prove
that even one dialog can be replaced, such that other people can realise it's
possible. and, importantly, whilst replacements for the menu options are
being developed, font developers can continue to use either the replacements
or the existing code.
why do this at all?
well, fontforge's widget set was developed from scratch at a time when
widget sets didn't handle unicode (which fontforge has to) and many more
things which are listed on the fontforge FAQ. however, as time has
progressed, _some_ features of widget sets - not all - have caught up. for
example, the FF FAQ states that GTK can only do one type of RGB bitmap but
FF requires several, and so on.
but, some of the fontforge input boxes are... archaic: for example there is no
mouse-wheel-driven input widget, so font developers are forced to type in
numbers (which often involves them looking down at the keyboard, not at the
screen).
to replace such widgets and to generally make any kind of UI changes is...
tiresome, as the code - including its widget set - is entirely written in c.
so, to make the job easier, the experiment is to implement an example menu
option in several different python-based widget sets, and see which one flies.
personally, i like pyjamas, not least because - believe it or not - its use
means that fontforge could turn into a client-server application (!) using
JSONRPC to get at the data, and the front-end GUI could be run in a modern
web browser.
but, to be a proper experiment, several widget sets will be tried. so far i have
a pygtk / cairo experiment up and running, and also a pyjamas (gwtcanvas)
one. all really quite exciting. ultimately, it is hoped that it will be possible to
use fontforge-nox with python bindings, and drop the main fontforge
window, replace it with pygtk / pyjamas / pyqt4 / pyclutter and... done!