Tuesday, January 15, 2013

Fix the Helvetica Font Error in Xscreensaver Glslideshow

The Problem: Xscreensaver displays an error message in both Ubuntu and Linux Mint when running Glslideshow, because a missing font is referenced in the glslideshow hack. The error message is "unable to load font "-*-helvetica-medium-r-normal-*-180-*", using "fixed". Helvetica is a copyrighted font, and Adobe is the copyright holder. You can buy the font, or you can modify glslideshow's source, or you can try a workaround.

The Solution: This is only a workaround instead of a proper solution, such as fixing and recompiling the source code, but it is easy and won't take but five minutes. We can get rid of the error message, if not the error itself. The error will still arise, but we don't need to see it anymore.

Open your file manager. Navigate to your home directory and turn on the option to view hidden files. Edit the hidden file, .xscreensaver, (~/.xscreensaver) as root. If the file does not exist, you may create it. You must edit the file as root in order to modify the file.

Change the option:

captureStderr: True

to

captureStderr: False

Although it may not be necessary, I also changed

overlayStderr: True

to

overlayStderr: False

I suggest also changing the option Font from Helvetica to: *-medium-r-*-140-*-m-*, although by itself this will not eliminate the initial error message displayed on the first picture. The problem lies in a hardcoded reference to Helvetica found within glslideshow's source code. With a hex editor, one could fix glslideshow's binary for good, changing helvetica to a font that is installed on Ubuntu and its derivatives, but that's dodgy, as a future update would wipe out the change.

While you're editing your xscreensaver file, examine the ImageDirectory option and change it to whichever directory you intend to store your slideshow pictures. Some of the other options are self-explanatory. The mysterious "nice" option just refers to Xscreensaver's priority in comparison to other programs. The default, ten, is low but higher will make it even lower. I left that one alone.

When you're done playing around with the options, save the file and exit.

Now let's edit two more files, found in /etc/X11/app-defaults: XScreenSaver and XScreenSaver-gl. It may not be necessary to change the Stderr options in these files, because according to the comments, the config file in your Home directory takes precedence. I went ahead and changed the options anyway just to be sure that the error message would not display everytime I ran the slideshow. I also changed all references to Helvetica with some other font. "*-medium-r-*-140-*-m-*" should work for this purpose.

The end result is a cleaner slideshow experience without that error message popping up everytime the screensaver activates.Post a Comment
by igor 04:20 4 replies by igor 09:32 0 comments

11 comments:

Anonymous said...

Thank-you so much! Such a tiny error but so annoying; couldn't find this answer anywhere else. Thank-you!

igor said...

This problem drove me up the wall when I configured my very first Linux Mint htpc with Xfce. After many hours of experimentation with a hundred different solutions, this was the surprising easy fix. My little tutorial probably errs on the side of conservatism; it may only be necessary to modify one setting in one file. But I edited a couple of settings in several files. I think xscreensaver only reads one file, but I was not certain of the precedence it assigned to the different file locations.

Anonymous said...

Great, helped me too !

Chris Koknat said...

$ sudo apt-get install xfs xfstt
$ sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi
$ sudo reboot
$ xlsfonts "*"helvetica"*"

Thanks to http://ibohm.blogspot.com/2012/09/qmon-failed-to-start-due-to-missing.html

igor said...

I have not tried your solution, but it looks plausible to me and safe, as you are only calling upon the user's default repository. Perhaps others will find it works for them.

It is puzzling why the author of the Glphotoshow hack opted to use a nonfree font. Who really cares what font is used, as long as it is legible and not too annoying.

cachergeoff said...

As a new Ubuntu user I am not sure how to log in as root. All the info I can find warns me against it.

Any thoughts?

igor said...

the root account is set up during installation. i am not sure how to do it and would have to google that. I suggest you google that.

langegabriel said...

I was having a similar problem trying to get molecule to work. Chris Koknat's approach got me 99% there. I had to, in addition, do the following.

$ xset fp+ /usr/share/fonts/X11/100dpi/
$ xset fp+ /usr/share/fonts/X11/75dpi/
$ xset fp rehash

You may need to sudo those commands to have them apply to all logins.

Peter Bratton said...

Chris Koknat's post got me 100% there. I'm on Mint 17, xScreensaver 5.34.1 64-bit. The only screensaver I use is glslideshow to display images under /home/peter/Pictures. The default filename text was tiny. Changing the font in ~/.xscreensaver didn't work. In fact only the second and third lines of Chris' post were needed. The first would have me install xfs (doesn't exist) and xfstt. Someone else reported xfstt wasn't needed so I decided to try the bare minimum,
$ sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi
After rebooting (Chris' line 3), it worked perfectly. The slideshow text is larger, easily visible, and I no longer see "unable to load font "-*-helvetica-medium-r-normal-*-180-*", using "fixed" every time I run xscreensaver-demo.
Thank you Chris!

Anonymous said...

thanks from 2020 :)

Anonymous said...

thanks #2 from 2020 :-)
here it worked with just apt-getting both xfonts-NN-dpi packages

techlorebyigor is my personal journal for ideas & opinions