Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"FontForge module is probably not installed" #225

Closed
bookercodes opened this issue Dec 18, 2017 · 18 comments
Closed

"FontForge module is probably not installed" #225

bookercodes opened this issue Dec 18, 2017 · 18 comments

Comments

@bookercodes
Copy link

bookercodes commented Dec 18, 2017

As per the install instructions, when I install FontForge via Homebrew and run ./font-patcher, I see the following error:

$ brew install fontforge
$ git clone --depth 1 https://github.com/ryanoasis/nerd-fonts
$ cd nerd-fonts
$ ./font-patcher

ERROR: Nerd Fonts: FontForge module is probably not installed. 
[See: http://designwithfontforge.com/en-US/Installing_Fontforge.html]**

@bookercodes
Copy link
Author

bookercodes commented Dec 18, 2017

In a nutshell, this happens when the ./font-patcher script tries to import psMat.

For some reason, when you install FontForge with Homebrew, psMat is unavailable.

To fix this, run:

  mkdir -p /Users/<YOUR USERNAME>/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/<YOUR USERNAME>/Library/Python/2.7/lib/python/site-packages/homebrew.pth

Remembering to replacing <YOUR USERNAME> with your username.

@bookercodes
Copy link
Author

bookercodes commented Dec 18, 2017

What you can also do is

brew rm fontforge
brew install fontforge

And observe the instructions carefully:

~/Code/nerd-fonts master
❯  brew install fontforge                                                                               
==> Downloading https://homebrew.bintray.com/bottles/fontforge-20170731_2.high_sierra.bottle.1.tar.gz
Already downloaded: /Users/booker/Library/Caches/Homebrew/fontforge-20170731_2.high_sierra.bottle.1.tar.gz
==> Pouring fontforge-20170731_2.high_sierra.bottle.1.tar.gz
==> Caveats
This formula only installs the command line utilities.

FontForge.app can be downloaded directly from the website:
  https://fontforge.github.io

Alternatively, install with Homebrew-Cask:
  brew cask install fontforge

Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
  mkdir -p /Users/booker/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/booker/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/fontforge/20170731_2: 1,249 files, 26.4MB

See, how it mentions that to use psMat in a script, you need to run the above commands. I skimmed this and it cost me an hour, hopefully I can save you some time 👍

@jcklpe
Copy link

jcklpe commented Jul 20, 2018

@bookercodes Does this apply for if I'm trying to run the script inside WSL Ubuntu for Windows?

@jcklpe
Copy link

jcklpe commented Jul 21, 2018

hey @bookercodes I tried this on both my Ubuntu 18.04 on WSL Windows installation and also on my plain fresh install Kubuntu 18.04 installation. Same error as you but I'm not on Mac or using Homebrew so not sure why it's not working. Any thoughts?

@diedummydie
Copy link

"FontForge module is probably not installed"

I'm on macOS 10.14, and I had that error. Following the instructions printed in the error message lead me to install the FontForge application and XQuartz, but not the command line tools, so I still kept getting that error, even after running the two path commands. (Don't follow the error message's instructions; FontForge.app and XQuartz do not help.)

Then I installed FontForge with homebrew as @bookercodes suggested, and everything worked.

Get the Nerd Fonts patcher from here: https://github.com/ryanoasis/nerd-fonts

Get Xcode from the App Store if you don't already have it, or get just the command line tools from here: https://developer.apple.com/download/more/

Get homebrew from here if you don't already have it: https://brew.sh

Then run the following three commands. (By the way, with "~" in the path, you don't have to add in your own username; just copy/paste as-is.)

brew install fontforge
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

Then, from the extracted nerd-fonts-master folder...

./font-patcher -q --powerline /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-Regular.otf
./font-patcher -q --powerline /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-RegularItalic.otf
./font-patcher -q --powerline /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-Bold.otf
./font-patcher -q --powerline /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/SFMono-BoldItalic.otf
open .

That places the patched copies of the fonts in the nerd-fonts-master folder and opens that folder in Finder so you can install them by double-clicking. (It's a good idea to do the Italic and Bold variants too like this so you have a full font family.)

TL;DR: Confirmation that newer versions of Nerd Patcher do work with SF Mono.

@diedummydie
Copy link

@jcklpe you should be good if you just sudo apt-get install fontforge and watch for any messages that might show up to give you extra steps. Really there probably won't be extra steps to take with a full/proper Linux package manager like apt.

@zamazir
Copy link

zamazir commented Feb 19, 2019

I received this error on Ubuntu 18.04 after installing fontforge with sudo apt install fontforge. The output listed python-fontforge as one of the "Suggested packages". After a sudo apt install python-fontforge I only needed an additional sudo apt install python-configparser to get everything running. You may want to use pip for this instead.

@ast3150
Copy link

ast3150 commented Jul 3, 2019

For me it helped to first install FontForge with brew install fontforge and cloning the nerd-fonts Git Repo. Then I navigated to the repo, checked out version 2.0.0 and instead of running font-patcher directly, I used fontforge -script ./font-patcher -q --powerline <path_to_font>

@iiison
Copy link

iiison commented Aug 7, 2019

I'm trying to patch a font on mac 10.14. I've followed all the instructions. I'm still getting this error.

I've downgraded my python version from 3 to 2.7 but it still doesn't work. I've also tried to install XCode command-line tools. but I couldn't get it to work.

can someone please help me...

@iiison
Copy link

iiison commented Aug 7, 2019

@ast3150 I did brew install fontforge then I did brew cask install fontforge. I'm still not able to access fontforge from iterm. Did you do additional stuff in order to access it from terminal.

@icycandy
Copy link

icycandy commented Apr 14, 2020

@iiison try this, succeed in macOS 10.15.4

brew install fontforge
brew link fontforge

then open a new terminal tab, run

fontforge -script ./font-patcher -q --complete <path_to_font>

@iiison
Copy link

iiison commented May 16, 2020

@icycandy it worked! thanks 🙏

@Hebgbs
Copy link

Hebgbs commented May 18, 2020

This issue rears its ugly head again in Ubuntu 20.04. Rather than creating a duplicate, putting it here to necro this since it's the same problem I am encountering right now.

@someone-stole-my-name
Copy link

someone-stole-my-name commented May 22, 2020

This issue rears its ugly head again in Ubuntu 20.04. Rather than creating a duplicate, putting it here to necro this since it's the same problem I am encountering right now.

I had the same problem... using Docker may be easier than debugging why python3-fontforge is broken on 20.04:

cd && git clone https://github.com/ryanoasis/nerd-fonts.git
docker run --rm -it -v ${COOL_FONT_PATH}:/fonts -v ~/nerd-fonts:/nerd chn2guevara/docker-nerd-fontforge:latest

cd /nerd && ./font-patcher /fonts/${FONT_FILE} -c -s -out /fonts/

@BobbyWibowo
Copy link

BobbyWibowo commented Nov 1, 2020

fontforge -script ./font-patcher -q --complete <path_to_font>

Doing this instead works for me on Ubuntu 20.04


Also works with the AppImage if you want to use newer FontForge:

~/Applications/FontForge-2020-03-14-67687b0-x86_64.AppImage -script $(pwd)/font-patcher -c -o $(pwd)/temp/out --progressbars $(pwd)/temp/OperatorMono/OperatorMono.otf

Using $(pwd) for paths is necessary since using AppImage changes work directory, which makes relative paths not work otherwise

Tehnix added a commit to Tehnix/nerd-fonts that referenced this issue Jan 3, 2021
Following issue ryanoasis#225 it seems fontforge has updated how it behaves after installing. For a consistent experience across 
various operating systems (Ubuntu, macOS, etc), it seems we get better results by pre-pending `fontforge --script ..` 
before running the `font-patcher` script.
@vermi
Copy link

vermi commented Feb 16, 2021

then open a new terminal tab, run

fontforge -script ./font-patcher -q --complete <path_to_font>

Sorry for beating a dead horse, but I've had the same issue and tried this solution. I instead end up with an error as follows:

Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 17:26 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
Warning: Mac string is a subset of the Windows string in the 'name' table
 for the Family string in the English (US) language.
Warning: Mac and Windows entries in the 'name' table differ for the
 SubFamily string in the language English (US)
 Mac String: Medium
Windows String: Regular
The requested file, original-source.otf, does not exist
Traceback (most recent call last):
  File "/Users/justin/./font-patcher", line 928, in <module>
    main()
  File "/Users/justin/./font-patcher", line 923, in main
    patcher.patch()
  File "/Users/justin/./font-patcher", line 88, in patch
    symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])
OSError: Open failed

@nyngwang
Copy link

nyngwang commented Apr 2, 2021

then open a new terminal tab, run

fontforge -script ./font-patcher -q --complete <path_to_font>

Sorry for beating a dead horse, but I've had the same issue and tried this solution. I instead end up with an error as follows:

Copyright (c) 2000-2020. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2020-11-16 17:26 UTC-D.
The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
Warning: Mac string is a subset of the Windows string in the 'name' table
 for the Family string in the English (US) language.
Warning: Mac and Windows entries in the 'name' table differ for the
 SubFamily string in the language English (US)
 Mac String: Medium
Windows String: Regular
The requested file, original-source.otf, does not exist
Traceback (most recent call last):
  File "/Users/justin/./font-patcher", line 928, in <module>
    main()
  File "/Users/justin/./font-patcher", line 923, in main
    patcher.patch()
  File "/Users/justin/./font-patcher", line 88, in patch
    symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])
OSError: Open failed

The error is caused by this line:

symfont = fontforge.open(__dir__ + "/src/glyphs/" + patch['Filename'])

So what you have to do is download the entire /src/glyphs/(not just glyphs/) and copy-paste it to where you run the font-patcher.

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests