I was prompted to write this tutorial after being contacted by a reader who had a question. Upon initial searching, I found that there are a bunch of articles and sites you have to wade through in order to install and run FontForge on Mac OS X. So I decided to figure out how to do it the simplest way.
To begin with, FontForge is not a regular OS X application. So there are some prerequisites in order to install it and get it running on your Mac. The method I have provided uses MacPorts. I tried the beta version .app and Homebrew, but neither seemed to be consistent across the different versions of OS X. I have always been a fan of MacPorts and once again it has proven to a solid performer. This tutorial was completed using OS X Mavericks 10.9.2, but I also tested on other versions as well. I ran successful installs on the following:
Mavericks 10.9.2
Mountain Lion 10.8.5
Snow Leopard 10.6.8
Install FontForge on Mac OS X using MacPorts
This method is a little involved and takes some time, but this method will reward your patience with a working version of FontForge on Mac OS X. The reason why it’s time consuming is that it gets built from the source code.
For this method you will need the following installed before beginning. If you do not have them, follow the links to learn how.
Once you have these installed you are ready to begin. If you are running on Snow Leopard then you will not have the Command Line Tools, as they are not available for Snow Leopard. I believe the specific version of MacPorts for Snow Leopard takes into account for this. But, that’s just a theory.
Install MacPorts by going to the following URL. Click the Download button in the upper right hand corner to get the package for particular OS X version.
Once you have it downloaded. Go to your Downloads folder and run the installer. Depending on your system’s security, you may be prompted for your password. Click “Next” and accept all the defaults until it begins to install.
Once the install finishes, you will need to configure MacPorts. Copy and paste the following lines into a terminal window.
Now, let’s install a few utilities that will make the install go smoothly. Run each of the following commands separately. Enter your user password if prompted. Also, keep in mind that these are getting compiled, so they can take a while to complete.
Once you have all those installed, it’s time to install FontForge. Type the following command and hit Enter.
Once it has finished, you’ll want to make an icon that you can click on in your Applications folder. Open up the “Apple Script Editor” and type the following line into the editor. My previous instruction was to copy and paste it in and some people were experiencing problems. One of our readers discovered the issue was with the copy/paste. Take a look at Glenn’s discovery in the comments section.
Save this script by going to File->Save. Name the script FontForge and be sure to change the file format to “application” format. Place it in your Applications folder or wherever will most convenient for you.
Next, go to your Applications folder and double click the icon. You should see XQuartz or X11 open up, followed by FontForge!
Once you hit Enter, you should see the following resulting line(s)
Now, paste the following line below into the terminal window and hit Enter. You will see either “+universal” or “not 64-bit capable” as a response. As long as you see one of the two, everything is okay
.
Now would be a good time to reboot your computer. I’ve done it with and without, but for consistency across all the different OS’s, it’s better to just do a quick reboot.
This one definitely takes a while, so be patient.
There you go. That is the easiest and most consistent way to install FontForge on Mac OS X. Hopefully you are able to get it installed successfully. If not, leave a comment with the issue you are having.
You can also watch the video tutorial on our YouTube Channel here.
If you like this article please give it a +1 and share it with your friends!
Report for Jay:
For my Mac, which runs on 10.6.8, I needed to download not XCode 5.1 but 3.2.6, which did need some persistence to find:
http://adcdownload.apple.com/Developer_Tools/xcode_3.2.6_and_ios_sdk_4.3__final/xcode_3.2.6_and_ios_sdk_4.3.dmg
I was shocked by the size of it: 4.4GB! But it went very smooth and fast, maybe 40 minutes and it was done.
On the harddisk, the install takes up much more, maybe some 15GB?
However, I’m not sure that included XCode Command Line Tools, as written in your instructions. Is that a separate download? How to find out if that has been installed? I’m really new to this, remember—I only need it to perform my first-ever build: FontForge.
I decided to forget about the Command Line Tools for the time being and opened Terminal to install Homebrew. (I was glad I knew that Terminal was in the Utilities folder 🙂
I pasted in the line from point 1 of your instructions, got a warning that “improper use of the sudo command could lead to data loss or the deletion of important system files”, had to type my password without seeing any **** feedback… rather creepy all that!
Then: “Installation successful!” and: “You should run ’brew doctor’ *before* you install anything.” and “Now type: brew help”.
I did that and figured out I had to type “brew doctor” to run it. That gave the message:
“You must: brew install git” and “Your system is ready to brew”.
Venturing further, I did “brew install git” which downloaded git-1.9.1.tar.gz in a minute or two.
Just guessing: maybe this missing part was the culprit in my not being able to run Fontforge with XQuartz?
Then, after two messages had appearedg: “Downloading…etc” and “make prefix…etc” nothing happened anymore. I entered “brew doctor” again, but nothing came. Then suddenly some more messages came up, so I understood that it had been working all the time. (There was no progress bar, like with the GIT download.)
At the end, a Summary came up saying that git had been built in 5.2 minutes, and this time, Brew Doctor reported nothing except “Your system is ready to brew.” Yes!
I tried to open the Fontforge.app download from February 12 2014 you recommended, to see if the GIT install had made a difference, but no. So I took a deep breath and pasted in your step4 command line to build FontForge.
Alas, that didn’t work:
Error: Unknown command: fontforge
Kernel.exit
So I’m where I was, asking for help…
Hey Ge,
You definitely need the XCode Command Line Tools. I would say that’s probably the source of your issue if you didn’t install them. With XCode for Snow Leopard, you should be able to open XCode and go to Preferences->Downloads and install them from there. I know that with Mountain Lion and Mavericks it is a separate download, so if you don’t see it in Preferences, go to the Apple Developer site and you should be able to download them from there. I honestly don’t know if they have made it a separate download or not.
I imagine that’s why you were also prompted to install “git”. I didn’t receive that when I was installing. It’s quite possible it’s an OS specific thing. I ran my install on Mavericks. I’ll fire up a Snow Leopard VM and go through the steps on it to see if there is anything different. In the meantime, I would recommend installing the Command Line tools and trying again.
Keep at it man, you’re close!!
Thanks for the encouragement, I think I need it:
Alas, there’s no Downloads tab in the Preferences for XCode 3.2.6 and I get the impression there are no Command Line Tools for this version—see the clipping below from the Apple support site.
Also, I’ve now had one spontaneous reboot of my MacMini, which it has never done before XCode/XQuartz, and Finder windows seem to show the list of files slower than before… yikes!
Q: I’ve installed Xcode 4.3 or later. Where can I find the updated command line tools?
A: Xcode now provides an interface for downloading and installing the latest command line tools, such as Apple LLVM compiler and system headers. To install these tools, go to the Downloads tab within the Xcode Preferences menu and click “Install” next to the Command Line Tools entry.
Hi Ge,
A spontaneous reboot? That shouldn’t have anything to do with XCode, not sure what could have caused that. I apologize for the delayed response. I have been a little busy lately so I haven’t really been able to do any testing. I just now got a VM with Snow Leopard fired up and will see what’s what. I’ll keep you updated on what I find out.
Hi Ge,
You are correct, there are no Command Line Tools for that version of XCode on Snow Leopard. It seems Lion is the minimum version. I did find some workarounds which got me a little further, but not a fully working install. I’m not sure what is going on with Snow Leopard. The other method seems to work fine on other OSX versions. However, I do have some good news. I did figure out another way to install FontForge on Snow Leopard. I plan on writing a full tutorial on it and hopefully posting it tonight. Stay tuned…
Hey Ge,
I’ve updated the tutorial for FontForge. This method should work for you.
You’ll need to uninstall Homebrew first.
Wow!
Umm, what’s the Terminal command to uninstall Homebrew? (Sorry… :3 I just feel like the magician’s apprentice here)
Run these commands in a terminal window. Run each one separately, and if you run into a “permission denied” message. Rerun the command using “sudo” before it.
cd `brew –prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew
I also did a video tutorial for it as well. You can see it on the YouTube Channel here: http://youtu.be/76YF2wdB49w
Let me know how it goes!
I’ll certainly try it asap, although I don’t feel good with this blind entering of commands. If anything goes differently than intended, how would I notice if I don’t know what I’m doing?
In other words: It would be nice to see some explanation of what each line is doing, what it’s for, and what message Terminal should give back after executing it.
Maybe I’ll do “help cd” etc to get at least some idea what’s going on.
Thanks a lot for going this far — I’ll be reporting!
Gé
So I tried that, and overcame one hitch thanks to my having checked out ‘help cd’:
G-Mac-Mini:~ Ge$ cd `brew –prefix`
Error: Unknown command: –prefix
G-Mac-Mini:~ Ge$ cd `brew –p’
> rm -rf Cellar
> brew prune
> rm `git ls-files`
> rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
> rm -rf .git
> rm -rf ~/Library/Caches/Homebrew
>
Then I went back to the instructions: “Install MacPorts by going to the following URL.”
There’s no URL mentioned there, but I easily found this one:
https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.6-SnowLeopard.pkg
Step 3, configuring MacPorts, went smooth. Just mentioning that the instruction is missing the word “see”. Not a big deal, unless someone thinks the missing word is “enter”…
Reboot as advised, then Step 4.
The first install there failed and I have no idea why, so I post the complete Terminal feedback here even though it’s long. Little by little…
G-Mac-Mini:~ Ge$ sudo port install wget
Password:
—> Computing dependencies for wget
—> Dependencies to be installed: gettext expat libiconv gperf ncurses gmp gnutls autoconf m4 perl5 perl5.16 gdbm automake libidn libtasn1 libtool nettle p11-kit curl-ca-bundle desktop-file-utils pkgconfig popt libffi libxslt libxml2 xz zlib libgcrypt libgpg-error pcre bzip2 libedit
—> Fetching archive for expat
—> Attempting to fetch expat-2.1.0_0.darwin_10.i386.tbz2 from http://nue.de.packages.macports.org/macports/packages/expat
—> Attempting to fetch expat-2.1.0_0.darwin_10.i386.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/expat
—> Attempting to fetch expat-2.1.0_0.darwin_10.i386.tbz2 from http://lil.fr.packages.macports.org/expat
—> Fetching distfiles for expat
—> Attempting to fetch expat-2.1.0.tar.gz from http://switch.dl.sourceforge.net/project/expat/expat/2.1.0
—> Verifying checksums for expat
—> Extracting expat
—> Configuring expat
—> Building expat
—> Staging expat into destroot
—> Installing expat @2.1.0_0
—> Activating expat @2.1.0_0
Error: org.macports.activate for port expat returned: Image error: /opt/local/bin/xmlwf already exists and does not belong to a registered port. Unable to activate port expat. Use ‘port -f activate expat’ to force the activation.
Error: Failed to install expat
Please see the log file for port expat for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
Error: The following dependencies were not installed: gettext expat libiconv gperf ncurses gmp gnutls autoconf m4 perl5 perl5.16 gdbm automake libidn libtasn1 libtool nettle p11-kit curl-ca-bundle desktop-file-utils pkgconfig popt libffi libxslt libxml2 xz zlib libgcrypt libgpg-error pcre bzip2 libedit
To report a bug, follow the instructions in the guide:
http://guide.macports.org/#project.tickets
Error: Processing of port wget failed
Hi Ge,
Your comment got caught in my spam folder… I would try deleting the xmlwf that is located at “/opt/local/bin/” and then try installing wget again. That looks to be the cause of the error. It’s probably left over from Homebrew. You can also try the suggestion of forcing the activation.
I would also put such stuff out of my way…
Anyway, I removed xmlwf, but then I get an error message that a certain file exists already, and if I delete it, another file. I did this three times now, with analog results:
1. Error: org.macports.activate for port expat returned: Image error: /opt/local/include/expat.h already exists and does not belong to a registered port. Unable to activate port expat. Use ‘port -f activate expat’ to force the activation.
Error: Failed to install expat
2. Image error: /opt/local/include/expat_external.h already exists and does not belong to a registered port.
3. Image error: /opt/local/lib/libexpat.1.dylib already exists and does not belong to a registered port.
When I enter the suggested command I get an error as well:
G-Mac-Mini:~ Ge$ port -f activate expat
Error: Insufficient privileges to write to MacPorts install prefix.
I’m getting more and more the feeling of being a passenger flying a 747 and you’re the tower trying to talk me down. Down I’ll come sure enough…
Hi Ge,
You can try executing the command with “sudo”.
I’m not surprised at leftovers that need to be manually cleaned up.
Sometimes it just takes a little patience. I can’t tell you how many countless hours I have spent trying to port something to the Mac.
Got all the way through the process with no problems, but at the end when I go to save the do shell script “/opt/local/bin/fontforge &” in AppleScript Editor I get the following error message:
Syntax Error:
Expected “given”, “in”, “of”, expression, “with”, “without”, other parameter name, etc. but found unknown token.
Any suggestions?
Hey Derek,
Unfortunately that is a pretty generic error. What version of OSX are you using?
Have you tried going to that path and making sure that the FontForge File is there?
Are you making sure to change the file format when saving?
Try running it in Applescript first.
When it gives you an error does it highlight any portion of the command?
Keep me updated and I’ll continue to help you troubleshoot.
Have you watched the tutorial on our Youtube channel?
Hi Derek,
There is a resolution to the issue you are experiencing. One of our readers discovered that the issue is when you copy/paste the shell script into the Apple Editor. This an oversight on my part, I usually type the line in and in my original instruction I was telling readers to copy/paste the line, mainly for convenience. Hope you figured it out, but if not then hopefully this will solve your issue.
Hi!
Excellent tutorial, thank you sooo much for this! I had to reload FontForge on my iMac and this made it easy for once.
I too had problems when I got to step 6, getting the following when I tried to save:
Syntax Error:
Expected “given”, “in”, “of”, expression, “with”, “without”, other parameter name, etc. but found unknown token.
HOWEVER- If the line was TYPED in (without copy/paste), it worked just fine. Don’t know enough about the AppleScript Editor to explain why this is, but wanted to share what worked.
Thanks again!
Hi again!
Just figured it out- When you copy/paste, you are using smart quotes in the AppleScript Editor. Retype the quotes so they are plain ones and things work just fine.
Hey Glenn,
I’m glad you found the tutorial useful!! Thanks for the great feedback.
I was unaware that copy/paste would cause that issue. I will be sure to update the tutorial.
Thanks for bringing it to my attention!!!
Hi Glenn,
Just wanted to let you know that I have updated the tutorial according to what you discovered, and gave you credit for it in Step #6. Thanks again!!!