Skip to content

Instantly share code, notes, and snippets.

@thetrevorharmon
Created June 19, 2018 17:36
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thetrevorharmon/9afdeb41a74f8f32b9561eeb83b10eff to your computer and use it in GitHub Desktop.
Save thetrevorharmon/9afdeb41a74f8f32b9561eeb83b10eff to your computer and use it in GitHub Desktop.
These commands help you install the Apple Font Tools, since their installer doesn't work on newer versions of macOS.
# Mount the font tools dmg as a volume on your Mac
hdiutil attach ~/Downloads/osxfonttools.dmg
# Navigate into the volume and copy
# the main .pkg file somewhere locally
# so you can manipulate it
cd /Volumes/OS\ X\ Font\ Tools/
pkgutil --expand OS\ X\ Font\ Tools.pkg ~/fontTools && cd ~/fontTools
# If you ls, here's what's in the file
#
# Distribution fontTools.pkg keyboardTools.pkg
# Resources fonttoolbox.pkg
#
# We'll be going into the fontTools.pkg first,
# and then going into the fontToolbox.pkg
# The fontTools.pkg includes the actual executables
# that we want to use to manipulate fonts
# navigate into the directory and use gunzip + tar
# to get at the files
cd fontTools.pkg
mv Payload Payload.gz && gunzip Payload && tar -xvf Payload
# If that command succeeded, you'll see the following output:
#
# x .
# x ./._.DS_Store
# x ./ftxanalyzer
# x ./ftxdiff
# x ./ftxdumperfuser
# x ./ftxdumpfond
# x ./ftxenhancer
# x ./ftxfissioner
# x ./ftxfusefond
# x ./ftxglyphadder
# x ./ftxinstalledfonts
# x ./ftxmakettc
# x ./ftxruler
# x ./ftxsplitter
# x ./ftxstamper
# x ./ftxsummarizer
# x ./ftxvalidator
#
# Additionally, all of those ftx* files will be in
# the current directory
# Move the executables to your local/bin so that
# they're in your bash path
mv ftx* /usr/local/bin
# At this point, you can successfully call any of the
# executables in your bash path, but they'll fail because
# they rely on FontToolbox.framework to be in /Library/Frameworks
# Navigate into the fonttoolbox.pkg directory and get at
# the payload like we did earlier
cd ../fonttoolbox.pkg
mv Payload Payload.gz && gunzip Payload && tar -xvf Payload
# This outputs a FontToolbox.framework folder in that directory
# Move that framework to the appropriate folder in /Library
# You need to sudo this command because of restrictions on the
# system level /Library folder
sudo mv FontToolbox.framework /Library/Frameworks/FontToolbox.framework
# If you made it this far, you should be able to use the
# Apple font tools from the command line!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment