[Xquartz-dev] The 2.1.0 package and Apple System Fonts

Ben Byer bbyer at apple.com
Sun Dec 2 22:24:47 PST 2007


Yeah, I think that's the point that's being lost here.

There are two completely different sets of font systems in use with  
X11 today -- "X11 core fonts" (which are rendered server-side) and  
client-side fonts, which generally use libXft.   Xft finds fonts using  
the fontconfig system  -- so any fc-* command will deal with that  
system.  Core fonts use the "font path" set in the server to find  
fonts, and then render them in the server -- these are the fonts you  
will see with xlsfonts / xfontsel.

There's more about this here: http://en.wikibooks.org/wiki/Guide_to_X11/Fonts

To expound a bit more:

* Modern applications generally use client-side font rendering, due to  
numerous limitations in the X11 core font system.  Here, I'm talking  
about OpenOffice, Gimp, etc.  Anything that uses gtk or Qt.  I think  
these applications can fall back on server-side fonts, if required,  
but that's really a last resort.  In order to get this working, you  
need to get fontconfig set up properly.

For Leopard, fontconfig was built with --with-confdir=/usr/X11/lib/X11/ 
fonts, so that's where it will look for the system-wide  
configuration.   (If you're seeing it look in /etc/, then your  
fontconfig was not built with that configure flag.)  In addition, I'm  
trying to add the following flags for future official Apple builds:   
'--with-default-fonts=/usr/X11/lib/X11/fonts --with-add-fonts="/System/ 
Library/Fonts,/Library/Fonts,~/Library/Fonts"')

fontconfig will also look for a local configuration file in your home  
directory (~/.fonts.conf, perhaps?)

There's quite a lot more that we can do to fontconfig to make it  
better play with OS X, including moving the cache files to /System/ 
Library/Caches and ~/Library/Caches, as appropriate.   I played around  
with this and ran into some weird bugs; I didn't have time to dig  
further.

Important commands: "fc-cache -v", fc-list.   Note that neither of  
these commands actually connects to the X server, as fontconfig is  
independent of X11.

* "Everything else" uses X11 core fonts, which are fraught with  
architectural limitations, but are sometimes all that you have  
(especially for any application which was not written from scratch  
within the last 5 years or so).   So, it's important to have these  
working, too.

The X server looks in a "font path" for fonts; you can see the current  
font path by running "xset q".  The default path is set at compile  
time.  It can be changed at runtime with the "xset fp" command.  It  
can also be changed in the X server configuration file -- although we  
don't ship one, the server should support one but I've never bothered  
to try.

Occasionally, you'll see people bring up xfs -- the X Font Server.   
Once upon a time, X servers in general didn't link against things like  
FreeType, and so they couldn't handle some of the more modern fonts,  
so people built font servers that filled in the gap in functionality  
because they couldn't fix it in the server.  There should no longer be  
any need for this.

Of course, moving sophisticated font processing in the server has  
performance issues and apparently stability ones, as well (I saw the  
crash mentioned earlier in this thread).

Important commands for X11 core fonts: mkfontdir, mkfontscale,  
xlsfonts, xfontsel, xset q, xset fp.


On Dec 2, 2007, at 4:54 PM, Jeremy Huddleston wrote:

> fontconfig is entirely client-side and is a separate process than  
> the xserver-provided fonts.
>
> --Jeremy
>
> On Dec 2, 2007, at 16:32, Merle Reinhart wrote:
>
>> One thing I was noticing when comparing the "xset q" output between  
>> Tiger and Leopard is on Leopard, at the bottom under 'Font cache:'  
>> is says 'Server does not have the FontCache Extension'.  It  
>> apparently does on Tiger as there is an active cache.
>>
>> As far as fontconfig goes, there is a lot of documentation in /usr/ 
>> X11/share/doc/fontconfig.
>>
>> I played around with defining a local ~/.fonts.conf like the docs  
>> described and pointed at some extra fonts in another directory.  fc- 
>> cache properly sees it, but the Xserver doesn't.  Perhaps the lack  
>> of the FontCache Extension is related?
>>
>> Merle
>>
>>
>>
>> On Dec 2, 2007, at 6:53 PM, Jeremy Huddleston wrote:
>>
>>>
>>> On Dec 2, 2007, at 14:17, Harald Hanche-Olsen wrote:
>>>> Disclaimers: I have no idea how X11 interacts with fontconfig. My  
>>>> only
>>>> practical experience with font servers was back in the days of X
>>>> terminals, and that was not in this century.  (The point being that
>>>> the X terminal, having no local file system, could only get its  
>>>> fonts
>>>> from a font server.  The font servers were fragile beasts that  
>>>> would
>>>> curl up and die if you looked at them crosswise, and we were glad  
>>>> to
>>>> get rid of them when the last X terminal left the building.)
>>>
>>> Ok, I found a good description for you from http://www.freshports.org/x11-fonts/libXft/ 
>>>  :
>>>
>>> The current version of Xft provides a client-side font API for X
>>> applications. It uses Fontconfig to select fonts and the X  
>>> protocol for
>>> rendering them. When available, Xft uses the Render extension to  
>>> accelerate
>>> text drawing. When Render is not available, Xft uses the core  
>>> protocol to draw
>>> client-side glyphs. This provides completely compatible support of  
>>> client-side
>>> fonts for all X servers.
>>>
>>> --Jeremy_______________________________________________
>>> Xquartz-dev mailing list
>>> Xquartz-dev at lists.macosforge.org
>>> http://lists.macosforge.org/mailman/listinfo/xquartz-dev
>>
>> _______________________________________________
>> Xquartz-dev mailing list
>> Xquartz-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo/xquartz-dev
>
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/xquartz-dev

Ben Byer
CoreOS / BSD Technology Group, XDarwin maintainer



More information about the Xquartz-dev mailing list