missing dejavusansmono in rrdtool pango cairo fontconfig

macports at parvis.nl macports at parvis.nl
Wed May 2 10:44:31 UTC 2018


> On 2018-04-13, at 19:02, macports at parvis.nl <mailto:macports at parvis.nl> wrote:
> 
> port -dv install pango +quartz +x11
> 
> i see : pango: checking which cairo font backends could be used... quartz freetype --> NO fontconfig
> 
> in the Cairo port are several andbales (edit: enables) and disables but nothing for fontconfig. could that be my problem?

Working on my new port for munin 2.x I had trouble using DejaVuSansMono in rrdtool.

opensnoop shows that DejaVuSans+DejaVuSansMono are replaced by Helvetica.

Part of the dependency chain is: munin->rrdtool->pango->cairo->fontconfig.

Macports installs fonts in /opt/local/share/fonts.
This directory is seen only by fontconfig (defined in /opt/local/etc/fonts/fonts.conf).

Most software uses cairo for advanced font handling and pango for the heavy-lifting in cairo. This is called pangocairo. rrdtool has '#include <pangocairo.h>'.

Pango has a simple tool to show font examples:
pango-view --backend=<backend> --text '   iiiiwwww  ' --font 'DejaVuSansMono 36' # execute in XQuartz
Note that backend is for pango, not for cairo.
With backend 'xft' or 'ft2' DejaVu shows fine.
With backend 'cairo' the replacement is done ('cairo' is the default backend for pango, see pangocairo).

The problem lies in cairo. If 'quartz' is enabled, 'fontconfig' is not used.
The Portfile for cairo explicitely enables 'quartz' and 'x11'.
With 'quartz' disabled everything works as expected.

I cannot oversee the consequences of disabling 'quartz' for cairo.

On the pango mailing list, Behdad Esfahbod offered the solution to set environment variable 'env var PANGOCAIRO_BACKEND=fc' and that works fine.

So I see several possible solutions:

1) do not force 'quartz' for cairo, but maybe hell will break loose.

2) add a warning for the user, like adding the following to the cairo Portfile:

        ui_msg "###########################################################"
        ui_msg "# If you installed your font with macports,"
        ui_msg "# and it is replaced by some other font,"
        ui_msg "# try to set this environment variable:
        ui_msg "#"
        ui_msg "#     export PANGOCAIRO_BACKEND=fc"
        ui_msg "###########################################################"

3) add some kind of warning on all fonts (port group?)

Please advise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20180502/13cb6ecf/attachment.html>


More information about the macports-dev mailing list