SparkyLinux Forums

Software & hardware support => Newbie questions => Topic started by: PelleB on January 05, 2021, 09:15:56 PM

Title: [UNSOLVED] Where do I set the font path?
Post by: PelleB on January 05, 2021, 09:15:56 PM
Hello all,

I need to add a directory to the font path but despite searching for quite some time, I could not figure out where (in which file) the font path is set.
Title: Re: Where do I set the font path?
Post by: bin on January 06, 2021, 06:55:58 AM
If fonts are added to the normal locations of either ~/.fonts or /usr/share/fonts then they'll be picked up automatically. Alternatively you can run sudo fc-cache -v
To save a lot of guesswork please explain the background to your question.
Title: Re: Where do I set the font path?
Post by: PelleB on January 06, 2021, 01:33:22 PM
QuoteTo save a lot of guesswork please explain the background to your question.

I want to use some bitmap fonts from the sgifonts package (Freebsd, Opensuse etc) and have them in their own subdirectory, which has to be added to the fontpath, or else xorg can not find them. This could be made in xorg.conf or by adding symlinks to /etc/X11/fontpath.d but these are missing here. xset +fp works, but is more for temporary changes.

The output of xset -q is:
Font Path:
  /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins
Title: Re: Where do I set the font path?
Post by: bin on January 07, 2021, 06:48:59 AM
My initial reaction is to just put them in with the /usr/share/fonts/X11/misc fonts.

However if for some reason you want them in a totally different location, why not just try a custom /etc/X11/xorg.conf


Section "Files"
    FontPath    "/location_of_the_fonts"
EndSection
Title: Re: Where do I set the font path?
Post by: PelleB on January 07, 2021, 08:46:02 AM
QuoteMy initial reaction is to just put them in with the /usr/share/fonts/X11/misc fonts.

I did that, it works but it is probably not the way it should be done.

QuoteHowever if for some reason you want them in a totally different location, why not just try a custom /etc/X11/xorg.conf

I tried that first, it made the x-server crash at startup even before I had added anything about font paths. I did not plan to place the fonts in a totally different location, just a different subdirectory, which still makes it necessary to add the path somewhere.
Title: Re: Where do I set the font path?
Post by: bin on January 07, 2021, 03:22:32 PM
Hmmm - OK, you could just put them in a folder in your ~/.fonts folder

If it's just for an application you use then that will work.

However, there's nothing *wrong* with dropping extra fonts into the X11 fonts - they're just fonts after all.
Title: Re: Where do I set the font path?
Post by: PelleB on January 07, 2021, 07:29:17 PM
~/.fonts is deprecated (say some configuration files)

Anyway, I will stay with the working solution and stop worrying about how it should be done. I use the fonts for some older apps not understanding unicode, including some windowmanagers and CDE.

Thanks for trying to help me!