Lokaltog/vim-powerline — Issue #13: Mac OS X: fontforge & fontpatcher works!
Author: pda
Created: 2012-01-10 10:12:18+00:00
State: open

Thanks for the impressive Powerline plugin!

I believe the following text in `fontpatcher/README.rst` can be replaced:

> Note for Mac users: The FontForge package in Homebrew isn't compiled with Python bindings, and will not work. I haven't been able to find a good solution for Mac users, please let me know if you've been able to install FontForge with Python bindings and how you did it and I'll update this README.

... with:

```
brew install --use-gcc fontforge
cd path/to/powerline/fontpatcher
fontforge -script fontpatcher MyFontFile.ttf
ls -l MyFontFile-Powerline.*
```

... because:

Homebrew does not build fontforge with the python extension (`--enable-pyextension`), and I could not persuade it to. However, the default is to build fontforge with an embedded python interpreter (opt-out with `--without-python`).

So, while you cannot `import fontforge` from python, you can `fontforge -script whatever.py`.

Here's the output I got building fontforge:

```
paul@paulbookpro ~ ⸩ brew install --use-gcc fontforge
==> Downloading http://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20110222.tar.bz2
File already downloaded in /Users/paul/Library/Caches/Homebrew
==> ./configure --prefix=/usr/local/Cellar/fontforge/20110222 --enable-double --without-freetype-bytecode
==> make
==> make install
==> Caveats
fontforge is an X11 application.

To install the Mac OS X wrapper application run:
brew linkapps
or:
ln -s /usr/local/Cellar/fontforge/20110222/FontForge.app /Applications
==> Summary
/usr/local/Cellar/fontforge/20110222: 270 files, 15M, built in 108 seconds
```

And here's the output of fontpatcher:

```
paul@paulbookpro ~/.vim/bundle/powerline/fontpatcher ⸩ fontforge -script fontpatcher Menlo.ttc
Copyright (c) 2000-2011 by George Williams.
Executable based on sources from 13:48 GMT 22-Feb-2011-D.
Library based on sources from 13:48 GMT 22-Feb-2011.
The following table(s) in the font have been ignored by FontForge
Ignoring 'hdmx' horizontal device metrics table
The glyph named mu is mapped to U+00B5.
But its name indicates it should be mapped to U+03BC.
The glyph named Delta is mapped to U+2206.
But its name indicates it should be mapped to U+0394.
```

That successfully produced `Menlo-Powerline.otf` which I was able to load with iTerm and get the special glyphs in Powerline.

Cheers,
Paul