[Fontconfig] /usr/local support

Damjan Jovanovic damjan.jov at gmail.com
Wed Jul 25 23:35:32 PDT 2007


Doing a "./configure --prefix=/usr" will generate a fonts.conf that
searches for fonts in /usr/share/fonts and some X11 fonts directory,
but completely ignores /usr/local/share/fonts. Any software that
installs itself to /usr/local and installs some custom fonts won't be
able to even find them unless the user is aware of the problem and
edits fonts.conf to include it

Man and info look for documents in /usr/local, gcc and binutils look for
headers and libraries in /usr/local, the freedesktop specs support
menus/icons/MIME types in /usr/local, and yet fontconfig completely
ignores /usr/local. I am aware that some Linux distributions provide
fonts.conf with <dir>/usr/local/share/fonts</dir> included, but many
don't, and not only is it better for you to support this as a matter
of policy, but it's also easier to fix the problem at the core than to
run tests on every distribution and persuade them all to do this.

Here (and attached) is a proposed patch for fontconfig-2.4.2 that adds
/usr/local/share/fonts to the font search paths. Changes to
./configure are not included.

--- a/configure.in	2006-12-03 01:24:39.000000000 +0200
+++ b/configure.in	2007-07-26 07:56:31.000000000 +0200
@@ -426,6 +426,14 @@
+	case x"$FC_ADD_FONTS" in
+	x)
+		FC_ADD_FONTS="/usr/local/share/fonts"
+		;;
+	*)
+		FC_ADD_FONTS="/usr/local/share/fonts,$FC_ADD_FONTS"
+		;;
+	esac
 	AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])

Please let me know if this is okay or if there is a better way.

Thank you
Damjan Jovanovic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fontconfig-usr-local.diff
Type: text/x-diff
Size: 392 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20070726/e4a043eb/attachment.diff 

More information about the Fontconfig mailing list