Opened 13 years ago

Last modified 13 years ago

#31580 new defect

MacPorts xfd renders fonts differently (and worse) from OSX xfd

Reported by: david.osguthorpe@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: font render x11 Cc: jeremyhu (Jeremy Huddleston Sequoia), ryandesign (Ryan Carsten Schmidt)
Port: xfd

Description

Fonts using Macports X11 sub-system (OSX X11 server) are rendered poorly compared to OSX X11 (example port is xfd)

Attached file shows screen grab for Menlo, but same rendering defects can be seen using Times, Courier

Note the random thickening seen in the capital letters and the thinness of the lowercase letters using Macports libraries (version on right) versus /usr/X11 libraries (version on left)

Commands to replicate: /opt/local/bin/xfd -fa Menlo /usr/X11/bin/xfd -fa Menlo

OXS Version 10.6.3 tested with fresh macports 2.0.3 install from dmg (no update/upgrade)

This is a general font rendering problem - xfd is the simplest port I found which displays the difference (the port which led me to this originally was GnuCash after changing to 2.0.3 - the font rendering in macports 1.8.1 for gnucash was better)

Adding a system_x11 variant to xfd Portfile to use OSX X11 libraries gives same rendering as /usr/X11/bin/xfd (libraries checked with otool -L)

It does not appear to be the freetype port or fontconfig port - macports versions of which can be combined with xfd and /usr/X11/lib to also give same rendering as /usr/X11/bin/xfd

Unfortunately the rest of the X11 system seems to be mutually exclusive (segmentation violation and unresolved inheritance errors) if eg try to link Xft2 with macports libraries and rest of xfd with /usr/X11/lib libraries - it seems the X11 and Xt libraries must come from same group - and these are direct dependencies of Xft2, xorg-libXaw and xfd itself

At the moment the only solution seems to be to resurrect a system_x11 variant for X11 ports I need for GnuCash

Attachments (1)

xfd_menlo_grab.tiff (117.0 KB) - added by david.osguthorpe@… 13 years ago.
Screen grab of two xfd windows showing font issue

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by david.osguthorpe@…

Attachment: xfd_menlo_grab.tiff added

Screen grab of two xfd windows showing font issue

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jeremyhu@… ryandesign@… added

Jeremy, any ideas?

comment:2 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

We have the same patches for freetype in XQuartz as in MacOSForge. XQuartz and MacOSForge both have unmodified libXft.

For me, all /usr/X11/bin, /opt/X11/bin, and /opt/local/bin versions render the same thing (all like the one on the right)

comment:3 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Oh, I notice the reporter is on SL ... so /usr/X11's freetype is a bit older. 2.4.x enabled the TT bytecode hinting. I think the version in SL might not have had the same hinting ... my guess is that this is a truetype bug.

Try reverting to an older version of truetype (2.3.6ish) to see if the issue goes away...

comment:4 in reply to:  3 Changed 13 years ago by david.osguthorpe@…

Replying to jeremyhu@…:

Oh, I notice the reporter is on SL ... so /usr/X11's freetype is a bit older. 2.4.x enabled the TT bytecode hinting. I think the version in SL might not have had the same hinting ... my guess is that this is a truetype bug.

Try reverting to an older version of truetype (2.3.6ish) to see if the issue goes away...

Thanks will try that

comment:5 Changed 13 years ago by su-v

Not sure if related at all - but what about enabling autohinting for fontconfig/freetype?

AFAICT the default installation of fontconfig in MacPorts does not copy

$PREFIX/etc/fonts/conf.avail/10-autohint.conf

into

$PREFIX/etc/fonts/conf.d

nor enable autohinting elsewhere (I saw the same issue with GTK+ GUI fonts - which render rather poorly after MacPorts upgraded to freetype 2.4.x (compared to MacPorts' freetype 2.3.x) - until I created ~/.fonts.conf and enabled autohinting there (see below)).

Enabling autohinting in ~/.fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

 <match target="font">
  <edit name="autohint" mode="assign">
   <bool>true</bool>
  </edit>
 </match>

</fontconfig>

comment:6 in reply to:  5 Changed 13 years ago by david.osguthorpe@…

Replying to suv-sf@…:

Not sure if related at all - but what about enabling autohinting for fontconfig/freetype?

Thanks very much - I can confirm this does indeed solve the problem

doing

ln -s ../conf.avail/10-autohint.conf

in /opt/local/etc/fonts/fonts.d

does give same results using macports X11 libraries as using the system X11 libraries

(as you say I saw this poor font rendering with all GTK+ programs - also I dual boot Ubuntu and the fonts on Ubuntu render similar to the System Libraries and not as the random thickening/very thin lines seen using Macports libraries without auto hinting)

comment:7 Changed 13 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Thanks. I've enabled that in XQuartz as well. Perhaps MP's fontconfig should make that symlink by default.

Note: See TracTickets for help on using tickets.