Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum Linuxiarze.pl

Author Topic: [UNSOLVED] Where do I set the font path?  (Read 621 times)

Offline PelleB

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
[UNSOLVED] Where do I set the font path?
« 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.
« Last Edit: January 07, 2021, 07:30:02 pm by PelleB »

Offline bin

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 2
Re: Where do I set the font path?
« Reply #1 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
Code: [Select]
sudo fc-cache -vTo save a lot of guesswork please explain the background to your question.

Offline PelleB

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Where do I set the font path?
« Reply #2 on: January 06, 2021, 01:33:22 pm »
Quote
To 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:
Code: [Select]
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

Offline bin

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 2
Re: Where do I set the font path?
« Reply #3 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

Offline PelleB

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Where do I set the font path?
« Reply #4 on: January 07, 2021, 08:46:02 am »
Quote
My 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.

Quote
However 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.

Offline bin

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 2
Re: Where do I set the font path?
« Reply #5 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.

Offline PelleB

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Where do I set the font path?
« Reply #6 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!