Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#69093 - [xorg-mkfontscale] don't delete empty fonts.dir

Attached to Project: Arch Linux
Opened by Alexandre Bouvier (doskoi) - Friday, 25 December 2020, 02:19 GMT
Last edited by Andreas Radke (AndyRTR) - Friday, 25 December 2020, 11:20 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Andreas Radke (AndyRTR)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

xorg-mkfontscale.script should not delete empty fonts.dir because this file is needed in a directory to be accepted as a font path by xorg-server. A directory with no fonts is useful to create a custom fonts.alias for fonts installed elsewhere and avoid conflicts with other fonts.alias files provided by system packages (e.g. /usr/share/fonts/misc/fonts.alias provided by extra/xorg-fonts-alias-misc). A fonts.alias file in one font path can define aliases for fonts located in any other font paths.

xorg-mkfontscale.script source code:
find "$d"fonts.{scale,dir} -maxdepth 0 -size -3c -delete

xorg-server source code:
/*
* xf86ValidateFontPath --
* Validates the user-specified font path. Each element that
* begins with a '/' is checked to make sure the directory exists.
* If the directory exists, the existence of a file named 'fonts.dir'
* is checked. If either check fails, an error is printed and the
* element is removed from the font path.
*/

mkfontdir manual:
The file "fonts.alias", which can be put in any directory of the font-path, is used to map new names to existing fonts, and should be edited by hand.

/etc/X11/xorg.conf.d/custom.conf:
Section "Files"
FontPath "/usr/share/fonts/custom"
EndSection

/usr/share/fonts/custom/fonts.alias:
terminus -xos4-terminus-medium-r-normal--16-160-72-72-c-80-iso10646-1

The directory /usr/share/fonts/custom is not added to font paths because xorg-mkfontscale.script deletes his empty fonts.dir file.
This task depends upon

Comment by Jan Alexander Steffens (heftig) - Friday, 25 December 2020, 17:48 GMT
Shouldn't you pick a folder outside of /usr/share/fonts for unpackaged files, like in /usr/local/share/fonts?
Comment by Alexandre Bouvier (doskoi) - Saturday, 26 December 2020, 09:13 GMT
Well, it is a packaged file. All my config is a package.
Beside, using /usr/share/fonts can leverage the auto upate mechanism instead of manually executing mkfontdir on /usr/local/share/fonts.

Loading...