1

I am on Mac OS X and I would like to use a python script like this one to manipulate an OTF with fontforge. The problem is, how do I access fontforge? Do I need a special build for that?

This is what I get when I run the file

Traceback (most recent call last):
  File "myfile.py", line 6, in <module>
    import fontforge
ImportError: No module named fontforge

(line 6 is import fontforge)

topskip
  • 16,207
  • 15
  • 67
  • 99

3 Answers3

6

first uninstall what you currently have installed:

port uninstall fontforge

then install the python variant:

port install fontforge +python27

there's also a python26 variant. to see all variants port variants fontforge

kritzikratzi
  • 19,662
  • 1
  • 29
  • 40
0

I was also facing the same issue. Looks like you need to install python with brew and point to brew's python (as mentioned in @davelab6 comment). So first install python and fontforge

brew install python    
brew install fontforge

Then as mentioned here, add below to your .bashrc or .zshrc

export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Hope it works!

K1NGK0NG
  • 1
  • 1
-2

You can get the FontForge development version's python module with HomeBrew:

$ brew install python
$ brew install fontforge --HEAD
davelab6
  • 315
  • 1
  • 5