Wednesday, May 29, 2013

FontForge: Rounding out the platforms for binary distrubution

Earlier this year I made it simple to install FontForge on OSX. The process boiled down to expanding a zip file into /Applications. The libraries that fontforge uses have been all tinkered to work from inside the package, and the configuration files and other dynamically opened resources and theme are sought in the right place too.

Now after another stint I have FontForge running under 32bit Windows 7. So finally I had a use for that other OS sitting on my laptop for all this time ;) The first time I got it to run it looked like below. I created a silly glyph to make sure that bezier editing was responsive...


The plan is to have the theme in use so nice modern fonts are used in the menu, and other expected tweaks before making it a simple thing to install on Windows.

One, IMHO, very cool thing I did to get all this happening was to use the OpenSUSE Build System (OBS) to make the binaries. There are some DLL and header file drops for X floating around, but I tend to like to know where libraries that are being linked into the program have come from. Call me old fashioned. So in the process I cross compiled chunks of X Window for Windows on the OBS servers. My OBS win32 support repository contains these needed libraries, right through cairo and pango using the Xft backends to render.

There is a major a schism there: if you are porting a native GTK+2 application over to win32, then you will naturally want to use the win32 backends to cairo et al and have a more native win32 outcome. For FontForge however, the program wants to use the native X Window APIs and the pango xft backend. So you need to be sure that you can render text to an X Window using pango's xft backend to make your life simpler. That is what the pangotest project I created does, just put "hello world" on an X Window using pango-xft.

A big thanks to Keith Packard who provided encouragement at LCA earlier this year that my crazy cross compile on OBS plan should work. I had a great moment when I got xeyes to run, thinking that things might turn out well after the hours and hours trying to cross compile the right collection of X libraries.

I should also mention that I'm looking for a bit of freelance hacking again. So if you have an app you want to also run on OSX/Windows then I might be the guy to make that happen! :) Or if you have cool C/C++ work and are looking to expand your team then feel free to email me.

2 comments:

FrankK said...

I tried installing the latest build of fontforgewin from the openSUSE Build Service (2.0.0git.1373957495) on a Windows 7 x64 system.

After installing all missing dependencies from http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Factory/noarch/ I try to run fontforge. However, it gives the following error message at program start:

'The procedure entry point __gxx_personality_sj0 could not be located in the dynamic link library libstdc++.dll.

The libstdc++.dll is from a MinGW installation and is in the same directory.

xeyes and pangotest do start, however with the message that they cannot open a display.

What could have gone wrong here? Is there maybe a package available for fontforge on Windows with all dependencies included?

FrankK said...

The solution was to use a libstdc++-6.dll with support for SJLJ instructions. Such DLL can be found at e.g.: http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%204.7%20series/4.7.1-tdm-1%20SJLJ/gcc-4.7.1-tdm-1-c++.zip/download

The command line version is working now.