topskip
topskip

Reputation: 17335

fontforge python bindings with macports

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)

Upvotes: 1

Views: 3003

Answers (3)

K1NGK0NG
K1NGK0NG

Reputation: 1

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!

Upvotes: 0

kritzikratzi
kritzikratzi

Reputation: 20221

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

Upvotes: 6

davelab6
davelab6

Reputation: 330

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

$ brew install python
$ brew install fontforge --HEAD

Upvotes: -2

Related Questions