Skip to content

Instantly share code, notes, and snippets.

@tonyseek
Last active August 29, 2015 13:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tonyseek/9636400 to your computer and use it in GitHub Desktop.
Save tonyseek/9636400 to your computer and use it in GitHub Desktop.
Patch the Monaco font for vim-powerline/vim-airline in OS X.
PATCHED_FILENAME = "Monaco for Powerline.ttf"
$(PATCHED_FILENAME): Monaco.ttf fontpatcher.py fontpatcher-symbols.sfd
fontforge -script fontpatcher.py Monaco.ttf
@echo "(´・_・`) You can install the $(PATCHED_FILENAME) now."
Monaco.ttf: Monaco.dfont
fondu Monaco.dfont
rm *.bdf
Monaco.dfont:
cp /System/Library/Fonts/Monaco.dfont Monaco.dfont
fontpatcher-symbols.sfd:
git co f3ce37 -- fontpatcher-symbols.sfd
git reset fontpatcher-symbols.sfd
fontpatcher.py:
git co f3ce37 -- fontpatcher.py
git reset fontpatcher.py
  1. Clone the repository of powerline: git clone git@github.com:Lokaltog/powerline.git
  2. Put the Makefile into the powerline/font directory
  3. Run make
  4. Install the Monaco for Powerline.ttf and set it as non-ASCII font in your terminal such as iTerm2
@yriveiro
Copy link

The make command output this errors:

fontforge -script fontpatcher.py Monaco.ttf
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012-D.
 Library based on sources from 14:57 GMT 31-Jul-2012.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'Zapf' glyph reference table
  Ignoring 'fdsc' font descriptor table
  Ignoring 'fond'
  Ignoring 'hdmx' horizontal device metrics table
  Ignoring 'just' justification table (AAT version)
The glyph named mu is mapped to U+00B5.
But its name indicates it should be mapped to U+03BC.
The glyph named Omega is mapped to U+2126.
But its name indicates it should be mapped to U+03A9.
The glyph named Delta is mapped to U+2206.
But its name indicates it should be mapped to U+0394.
The glyph named Tcommaaccent is mapped to U+021A.
But its name indicates it should be mapped to U+0162.
The glyph named tcommaaccent is mapped to U+021B.
But its name indicates it should be mapped to U+0163.
The glyph named zerowidthjoiner is mapped to U+200D.
But its name indicates it should be mapped to U+FEFF.
The glyph named Ghemiddlehookcyrillic is mapped to U+0496.
But its name indicates it should be mapped to U+0494.
The glyph named ghemiddlehookcyrillic is mapped to U+0497.
But its name indicates it should be mapped to U+0495.
The glyph named sixroman is mapped to U+2179.
But its name indicates it should be mapped to U+2175.
The glyph named uni2094 is mapped to U+2071.
But its name indicates it should be mapped to U+2094.
The glyph named uni20C8 is mapped to U+20A0.
But its name indicates it should be mapped to U+20C8.
/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** ["Monaco] Error 2

The "Monaco for Powerline.ttf" is generated and works (apparently) with vim-airline.

Thanks for the script, you save me a lot of work.

@bsnux
Copy link

bsnux commented Jun 16, 2015

Before executing make you need to have installed some additional software. You can run following commands for installing required software:

brew install Caskroom/cask/xquartz
brew install fontforge
brew install fondu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment