Difference in rendering xft fonts in xorg-server and XQuartz.app

Richard Cobbe rcobbe at pobox.com
Tue May 28 15:50:51 UTC 2019

On Tue, May 28, 2019 at 07:11:34AM -0500, Ryan Schmidt wrote:
> On May 28, 2019, at 02:55, Chris Jones wrote:
> > On 28/05/2019 1:25 am, Richard Cobbe wrote:

> >> I've put screen shots of the results at <https://imgur.com/a/TTNFx8b>.  The
> >> first image contains the results under XQuartz, and the second under
> >> xorg-server.  This is urxvt from the rxvt-unicode port, v9.22, on MacOS
> >> 10.14.5 started with the command
> >>         LC_CTYPE=en_US.UTF-8 urxvt -fn xft:Consolas:pixelsize=16
> >> I prefer the first rendering quite strongly.  Is there a way (installing
> >> a missing package, perhaps?) for me to get this rendering in xorg-server?
> >
> > Honestly, I cannot see any difference between those two screen shots. What exactly is it about the [first] you say is different and you prefer ?
> The font appears to be different. Look at the lowercase "i" which has a bottom serif in the first screenshot, while it doesn't in the second screenshot. I see subtle differences in other letters as well, like the lowercase "l" which is more curved in the first screenshot than in the second and the capital "Q" which has a straight tail in the first screenshot but a curved one in the second. Overall the text in the first screenshot has a slightly heavier weight as well.

Oh, good catch -- I hadn't even noticed that they're different fonts!  I
chiefly noticed the heavier weight and the tighter letterspacing in the
first screenshot, both of which make the first one far easier on my eyes.
(Part of this effect may be due to differences in how the two servers do
the rendering on the relevant display, a brand-new MacBook Pro, or due to
the precise brightness etc. settings.  These effects may or may not be
reflected in the screenshots.)

> It appears to me that the first (i.e. liked) font is Menlo 13 while the second (disliked) font is Andale Mono 13. I too like Menlo a lot and have been using it in my Terminal since Apple started shipping it with macOS.

Actually, the first font is Consolas, although Menlo is quite nice too.
The second one could easily be Andale Mono, as I do have it installed on
the machine, but I'm not really sure.

> I don't know where X11 or its terminal stores its font settings...

X11 font management is a deep mystery to me.  I can tell you that urxvt,
like a number of other terminal programs, accepts its font settings via the
-fn switch in my original post, as well as a couple of other places.  I
don't fully understand the precise values one can pass to the -fn switch,
but the value quoted above has worked for me under XQuartz for years, with
pixelsize adjusted slightly for different displays and as my eyes have
gotten worse over time.

This may or may not be relevant, but I usually configure that setting via
the following entry in the X resource database, but I commented that out
in favor of the command line for the purposes of this investigation.

    URxvt.font:                     xft:Consolas:size=16

Oh, that's interesting -- I just realized that I'm not consistent here in
the size-vs-pixelsize option in the font string.  Once I get home from work
this evening, I'll investigate whether that makes a difference, though it
seems unlikely.

The main problem, as far as I can tell, is that xorg-server and XQuartz
interpret the same font specification differently.  This suggests that it's
a server problem (or at least a server configuration problem), but I have
no idea where to start debugging this.


More information about the macports-users mailing list