Skip to content

Commit

Permalink
font-patcher: Correct python module missing message
Browse files Browse the repository at this point in the history
[why]
When the fontforge python bindings are not installed we fail while
importing psMat. The message suggests that fontforge itself is not
installed - which is not the real reason. One can use the libfontforfge
with the python-fontforge without having the GUI program fontforge.

Furthermore we link to outdated installation instructions.

[how]
We already check and report correctly what needs to be done with the
fontforge module import. As both modules are often in the same package
we should probably report the same message. That message holds correct
hints for Debian/Ubuntu. It does not have a link to fontforge, though.

[note]
Also update Debian package name.

Fixes: #725

Reported-by: Aniket Teredesai <[email protected]>
Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Sep 6, 2022
1 parent 6564e71 commit ac60053
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ projectNameAbbreviation = "NF"
projectNameSingular = projectName[:-1]

import sys
try:
import psMat
except ImportError:
sys.exit(projectName + ": FontForge module is probably not installed. [See: http://designwithfontforge.com/en-US/Installing_Fontforge.html]")
import re
import os
import argparse
Expand All @@ -30,12 +26,13 @@ try:
except ImportError:
sys.exit(projectName + ": configparser module is probably not installed. Try `pip install configparser` or equivalent")
try:
import psMat
import fontforge
except ImportError:
sys.exit(
projectName + (
": FontForge module could not be loaded. Try installing fontforge python bindings "
"[e.g. on Linux Debian or Ubuntu: `sudo apt install fontforge python-fontforge`]"
"[e.g. on Linux Debian or Ubuntu: `sudo apt install fontforge python3-fontforge`]"
)
)

Expand Down

0 comments on commit ac60053

Please sign in to comment.