You are not logged in.

#1 2019-02-09 19:26:35

rallyemax
Member
Registered: 2012-11-09
Posts: 10

How are default FontPaths set in X?

I am trying to determine how some, but not all, of the font subdirectories in /usr/share/fonts are being included in my X server's FontPath. There are no FontPath directives in any of the files in /etc/X11/xorg.conf.d or /usr/share/X11/xorg.conf.d. Based on the logs, the server is searching the following /usr/share/fonts/ subdirectories for fonts.dir:

Type1, 100dpi, 75dpi, misc, TTF, and OTF

Some of those exist but do not contain fonts.dir, so the FontPath is set to:

/usr/share/fonts/misc,/usr/share/fonts/TTF,/usr/share/fonts/OTF,built-ins

I have a few other subdirectories in /usr/share/fonts, most of which had been installed via binary packages from Arch repos. These include cantarell, gsfonts. Both subdirectories contain fonts.dir and fonts.scale, so the mkfontscale and mkfontdir hooks successfully ran when they were installed.

I would like to include these in my FontPath. The straightforward way to do so is to manually create a file in /etc/X11/xorg.conf.d. But it seems like there is some sort of automated mechanism that placed the Type1, 100dpi, 75dpi, misc, TTF, and OTF paths in the FontPath, and it's bugging me that I can't find it...

I would MUCH rather extend this automated mechanism somehow (probably via a pacman hook that, like mkfontscale/-dir, runs whenever something is dropped into /usr/share/fonts) than to remember that I have to manually edit X's conf files every time I decide to add or remove a font. I mean, I'm here, so I obviously don't mind messing about in configuration files, but some things really ought to be automated. If updating fontconfig whenever a font is installed is done automatically via a pacman hook, I'd like to do the same for X...

Please share any insight that may be helpful even if you can't answer everything. Thanks!

Offline

#2 2019-02-09 19:36:59

loqs
Member
Registered: 2014-03-06
Posts: 8,173

Re: How are default FontPaths set in X?

It is set at buildtime see https://github.com/mirror/xserver/blob/ … build#L123 as the PKGBUILD does not specify default_font_path
So it appends entries to fontrootdir = fontutil_dep.get_pkgconfig_variable('fontrootdir') which https://git.archlinux.org/svntogit/pack … -font-util set it to /usr/share/fonts.
Edit:
Are the fonts from gsfonts as an example you had installed not available to an application using the X font server?

Last edited by loqs (2019-02-09 20:50:33)

Offline

Board footer

Powered by FluxBB