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

Add error handler for GNUstep apps missing their fonts #16

Open
darkoverlordofdata opened this issue Jul 7, 2021 · 5 comments
Open

Comments

@darkoverlordofdata
Copy link

GNUstep gui programs failing

To Reproduce
Steps to reproduce the behavior:

2 examples

sudo pkg install gnustep systempreferences
openapp SystemPreferences

or

sudo pkg install gmines
open startvalume.
drill down to /usr/local/GNUstep/System//Applications
click on gmines

Expected behavior
I expect a gui to open displaying the gnustep sysm preferences
or
I expect to play gmines
__
Screenshots
2021-07-06-231417_1368x768_scrot

Version (please complete the following information):

Computer (please complete the following information):

  • Device: ASUS ZenBook UX305UA

Additional context
the compiler is working, and my programs that use command line or X11, or SDL2 are working.
But programs using the native AppKit for their gui all fail. Example:

sudo pkg install gnustep systempreferences
openapp SystemPreferences

fails with pages and pages of:
2021-07-06 23:49:37.960 SystemPreferences[14543:101571] The font specified for NSFont, Helvetica, can't be found.

Also, the Helvetica font seems to be installed:
darko@sudanna /usr/local/GNUstep/System/Library/Fonts/Helvetica.nfont $ ls
FontInfo.plist n019004l.pfb n019024l.afm n019043l.pfm n019063l.pfb
n019003l.afm n019004l.pfm n019024l.pfb n019044l.afm n019063l.pfm
n019003l.pfb n019023l.afm n019024l.pfm n019044l.pfb n019064l.afm
n019003l.pfm n019023l.pfb n019043l.afm n019044l.pfm n019064l.pfb
n019004l.afm n019023l.pfm n019043l.pfb n019063l.afm n019064l.pfm

@probonopd
Copy link
Member

probonopd commented Jul 7, 2021

Hello @darkoverlordofdata.

Try sudo pkg install -f gnustep-back. It seems to contain the missing fonts.
https://www.freshports.org/x11-toolkits/gnustep-back/

@darkoverlordofdata
Copy link
Author

It just says"The most recent versions of packages are already installed". gnustep-back installs as a dependancy of gnustep. and I can see the fonts, it's just gnustep doesn't see them. I'm thinking that there is a missing config somewhere.

@darkoverlordofdata
Copy link
Author

I found this debian bug from 2010 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596159, it says workaround helloSystem/ISO#1 is to Install ttf-freefont

sudo pkg install freefont-ttf fixed the issue. Now I can play GMines!

@probonopd
Copy link
Member

probonopd commented Jul 10, 2021

We could add an error handler to the launch command for this, telling the user to install that package rather than quoting the raw "The font specified for NSFont, Helvetica, can't be found" error message.

Something like this:

--- a/src/main.cpp
+++ b/src/main.cpp
@@ -96,6 +96,7 @@ void handleError(QDetachableProcess *p, QString errorString){
 
     QRegExp rx(".*ld-elf.so.1: (.*): version (.*) required by (.*) not found.*");
     QRegExp rxPy(".*ModuleNotFoundError: No module named '(.*)'.*");
+    QRegExp rxGnuStep(".*The font specified for NSFont, Helvetica, can't be found.*");
     QFileInfo fi(p->program());
     QString title = fi.completeBaseName(); // https://doc.qt.io/qt-5/qfileinfo.html#completeBaseName
     if(errorString.contains("FATAL: kernel too old")) {
@@ -120,6 +121,9 @@ void handleError(QDetachableProcess *p, QString errorString){
         QString missingPyModule = rxPy.cap(1);
         QString cleartextString = QString("This application requires the Python module %1 to run.\n\nPlease install it and try again.").arg(missingPyModule);
         qmesg.warning( nullptr, title, cleartextString );
+    } else if (rxGnuStep.indexIn(errorString) == 0) {
+        QString cleartextString = QString("This application requires ttf-freefont package to run.\n\nPlease install it and try again.");
+        qmesg.warning( nullptr, title, cleartextString );
     } else {
         qmesg.warning( nullptr, title, errorString );
     }

@probonopd probonopd changed the title GNUstep gui programs failing Add error handler for GNUstep apps missing their fonts Jul 10, 2021
@probonopd probonopd transferred this issue from helloSystem/ISO Jul 10, 2021
@probonopd
Copy link
Member

It seems like it is missing the dependency on ttf-freefont:

% sudo pkg install gmines
Password:
Updating FreeBSD repository catalogue...
Fetching packagesite.txz: 100%    6 MiB 921.4kB/s    00:07    
Processing entries: 100%
FreeBSD repository update completed. 30505 packages processed.
All repositories are up to date.
The following 10 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        flac: 1.3.3_1
        flite: 2.1
        gmines: 0.2_8
        gnustep-back: 0.28.0
        gnustep-base: 1.27.0
        gnustep-gui: 0.28.0
        gnustep-make: 2.8.0
        libao: 1.2.0_5
        libobjc2: 2.1_3
        libsndfile: 1.0.31

Number of packages to be installed: 10

The process will require 98 MiB more space.
20 MiB to be downloaded.

Proceed with this action? [y/N]:

I think a bug should be opened at bugs.freebsd.org regarding the missing dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants