FontForge - you beautiful bastard
Posted on Tuesday, March 21, 2006 @ 18:30 CET
I spent the majority of my time today at work trying to get this piece of sh*t wonderful program
called FontForge to work. It really is quite
perfect, but I nearly ripped my hair out in the process of getting it to run on my system.
So the problem was as follows: we have a bunch of OTF (OpenType Fonts) that we're using in our project. Currently we're using a solution where we embed the fonts in shared SWFs using the Flash IDE so there is no problem at all. However, this solution has some issues so after Jensa found this post by Aral Balkan, we decided to try embedding the fonts using swfmill.
This can easily be done from within FlashDevelop in the Project panel - right-click the library, Add > Library Asset and select your font. Once its added you can right-click it, and in the Options, select which characters to embed and change the linkage ID. FlashDevelop then takes your settings and passes them magically to swfmill, so you don't have to worry about writing the XML to build this yourself. Great right? Not quite.
Unfortunately, swfmill only supports TTF's (TrueType Fonts), and we're using OTF's. So after scouring Google I came across FontForge that would convert the OTF's. Problem solved! Nearly.
There were 3 files available for download. An RPM (for Linux using the RedHat Package Manager), a SITX (for Mac) and a tar.bz2 file for usage with Cygwin on Windows. Ha!
The idea was, download Cygwin and install it with the necessary libraries. Cygwin would create a Linux-like environment in Windows and allow me to run the program, since it was Linux-based. The installer is tiny, and downloads all the libraries you select and then installs them. This took forever, each mirror I selected gave me a maximum download rate of 30 kbps, which just sucks. So half an hour later Cygwin is done, and I run it and lo and behold it can't find bash (a terminal for Linux). Its supposed to be in the bin/ folder, but of course, there is no bin/ folder. Hmmm.
Try again. Different mirror. Maybe there was an error with the libraries I downloaded. After another 30 minutes, nope - same problem.
Then I have a stroke of genius. A couple weeks ago I downloaded the excellent (and free) VMware Player that allows you to run a virtual machine of any OS (that runs on your processor). Not only is the player free, but they even have a couple pre-installed images available - so you can run another OS without having to first install it. Brilliant!
Having heard so much about Ubuntu, I decided to give this particular distribution a try. I've played with Mandrake, debian and RedHat - but they didn't have pre-built images for me (and I didn't need RedHat Enterprise).
So I fire up VMware and download the archive. I tried to follow the instructions but to no avail. I guess this is meant for usage under Cygwin. One last option. Download the source from SourceForge's CVS and compile it myself. That should work.
The pre-built image for Ubuntu is nothing more than a bare-bones installation and probably for 95% of its users thats more than enough. I've been using it for testing Flash content under Linux (Firefox comes installed) and it works great. But now I needed a developer setup - luckily I got some help and got very familiar with the Advanced Package Tool (apt).
First off was cvs itself. Search, locate, install. Then time to download the source files from SourceForge. Using CVS via the terminal is a royal pain in the anus - I am so thankful for GUI-based tools such as Tortoise CVS (even though getting it to remember your password took forever to figure out, but thats another post). So yes, GUI = good. I don't know how our back-end guys live in the terminal window without jumping out of one.
Once the source code was down, time to ./configure it. Ah, no compiler is available - time to find GCC. Search, locate, install. Try again. Hmm, GCC cannot create an executable? A Google search later, I found that I needed the "build-essential" package. Search, locate, install. Try again.
Now there were a bunch of libraries missing. binutils, libxml2, libjpeg, libgif-something, libpng, etc, etc. For each of those follow the same recipe. Search, locate, install. Try again. Then finally the configure utility actually finished without warnings. Well nearly. It couldn't find libx11-dev, so although it would compile everything for me it warned me that there would be no GUI available. Again, GUI = good - so, you guessed it, search, locate, install - try again.
Finally, configure made it through without any warnings and everything seemed good. Run make. It ended abruptly complaining that it couldn't find msgfmt. Who? Google search again. Apparently msgfmt creates a message object from a message file. Sounds important, and make wouldn't continue. So, search, locate... But there were no results. Must be inside another package. But what package? Asked around and found it was inside gettext. Search, locate, install. Try again.
Make finished! Time for "make install"... It took a while, but it worked! The moment of truth, ran "fontforge". It sputtered, and up came a splash screen. The program was running!
I copied over the OTF files, and opened them in FontForge. File > Generate Fonts - select TTF and save. And it worked. It worked perfectly. The fonts came out looking identical. Copied them back over to the Windows world and they worked like a charm. Swfmill was happy, the SWF was happy - all was good with the world.
So in the end, yes, the program was free - but it did cost significant time and effort. I am by no means a Linux-guru - and had I been this probably would not have taken the several hours it did - but to quote The Beatles, I get by with a little help from my friends (and Google).
- paulo





Comments:
Gah, and I was just thinking about doing exactly the same.. Think I'll stick with Arial then :)
# May 29, 2006 13:32 CET
Hehe, if I had the choice I would've done the same ;)
# May 29, 2006 21:15 CET
In case anyone else finds this, this helped me get the cygwin setup in windows. Pay attention to the libraries to include in the installer...
[PF] Edited the comment so the link would work, it got chomped somewhere along the lines
# May 24, 2007 21:52 CET
I was able to install cygwin and xwindows apparently successfully, but when I run fontforge.exe nothing happens. No error message, no fontforge window. Just nothing.
Any ideas?
David S.
# June 21, 2008 19:37 CET
@David S: did you try the link that David posted above? It explains the process in simpler terms and shows how to start up FontForge from within Cygwin.
# June 21, 2008 19:46 CET
Yes, thanks. I also posted my question (with screen shots) to the Cygwin mailing list.
David S.
# June 22, 2008 15:41 CET
The solution turned out to be that there is no automatic dependency info for FontForge. You have to select the correct support software in the Cygwin setup.exe tool. I finally got FontForge running after hours of work. The fault seems to be that FontForge isn't registered as an official Cygwin tool. Good luck!
# July 22, 2008 14:25 CET
Post a comment:
You must have Flash and JavaScript enabled to post a comment.