Subject: Re: what is /usr/pkg/lib/X11/? And fontconfig using ${LOCALBASE}/lib/X11/fonts
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 10/28/2003 11:31:11
On Tue, 28 Oct 2003 wrote:

> > Which is:
> >   --with-default-fonts=DIR      Use fonts from DIR when config is busted"
> IIRC, this directory is used as the first location (but not the only one!) to
> search for fonts.  Directories under /usr/X11R6 are always searched (as seen
> in the configuration file):
>         <dir>/usr/pkg/lib/X11/fonts</dir>
>         <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>
>         <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
>         <dir>~/.fonts</dir>

I have a PR about this (PR 22927). The configuration file looks for the
outline fonts in a few set directories. So on different systems running
pkgsrc, you have a good chance of getting a different fonts.conf

So in your example, you are missing:

(as Sebastian P.'s system also shows)


(as my system would have)

And the bad part is, if it doesn't detect the fonts (because you install
fontconfig before fonts that it may see), then later fc-cache won't do
anything useful. And you get warnings like:
Warning: Cannot convert string "" to type XftFont

My PR is to make it have a consistent configuration.

diff -b -u -r1.17 Makefile
--- fonts/fontconfig/Makefile	2003/10/11 13:40:19	1.17
+++ fonts/fontconfig/Makefile	2003/10/28 19:29:41
@@ -32,6 +32,7 @@
 CONFIGURE_ARGS+=	--with-expat-lib=${BUILDLINK_PREFIX.expat}/lib
 CONFIGURE_ARGS+=	--with-x
+CONFIGURE_ARGS+=	--with-add-fonts=${X11PREFIX}/lib/X11/fonts/TTF,${X11PREFIX}/lib/X11/fonts/TrueType,${X11PREFIX}/lib/X11/fonts/Type1,${X11PREFIX}/lib/X11/fonts/freefont

 EGDIR=		${PREFIX}/share/examples/fontconfig
 CONF_FILES=	${EGDIR}/fonts.conf ${PKG_SYSCONFDIR}/fonts.conf

The above is what I plan to commit.

Can anyone else send me the <dir> entries from their fonts.conf?

> Maybe those entries should be more generic and list lib/X11/fonts
> (without TTF and Type1) so that all of them are picked up.

The complaint then is that it will pick up too many bitmap fonts. Even
the configure scripts specifically looks for .ttf and .pf*, .tt* and .ot*
files. And configure says:
# Add more fonts if available.  By default, add only the directories
# with outline fonts; those with bitmaps can be added as desired in
# local.conf or ~/.fonts.conf

> > Does anyone really have fonts at that location?
> I guess that fonts will be installed there if you install packages providing
> fonts on a xpkgwedge'd system (at least this is what should happen).  So if
> you don't tell fontconfig to add that directory to the configuration file, it
> won't ever know about these fonts.

Okay, I see that makes sense (just by looking at
fonts/freefonts/Makefile). But before I was thinking that the xpkgwedge'd
system would just put the fonts to somewhere like

   Jeremy C. Reed