11

Out of the blue, my Gnuplot has started having issues with the pdfcairo terminal. The font in the produced PDF files is jammed as if the width of the individual characters was set to zero. I am using Gnuplot 5.2.7 on Mac OS, installed via homebrew.

Here, a minimal not-working example:

reset
set terminal pdfcairo
set output "mnwe.pdf"
set xlabel "Time t"
set ylabel "sin(t)"
plot [0:2*pi] sin(x) with lines notitle

which produces the following output:

enter image description here

I suspect that the font issue occurred after a recent update to patchlevel 7. Gnuplot 5.2.2 on my Ubuntu machine works as expected and produces the following output for the same Gnuplot script:

enter image description here

Unfortunately, it does not seem to be possible to revert to the previous Gnuplot version with homebrew.

I confirmed that the epscairo and pngcairo terminals work as expected on my Mac with Gnuplot 5.2.7, so the issue is solely with the pdfcairo terminal.
Edit: In fact, the bug does affect the other Cairo-based terminals as well. Don't know what I did wrong when I checked first.

I would appreciate any pointers at how to fix this.

bibi
  • 3,671
  • 5
  • 34
  • 50
alexurba
  • 1,674
  • 18
  • 13
  • 2
    There is a similar report on the gnuplot issue tracker that implicates use of pango version 1.44 in the recent homebrew build of gnuplot 5.2.7. https://sourceforge.net/p/gnuplot/bugs/2194/ – Ethan Aug 30 '19 at 18:30
  • 1
    FYI here is the issue on the pango git: https://gitlab.gnome.org/GNOME/pango/issues/422 – bibi Sep 19 '19 at 08:03
  • 1
    Thank you @bibi! This is still an issue in gnuplot 5.2.8. – andyras Dec 27 '19 at 23:35

3 Answers3

17

For Homebrew, I changed the pango formula to stick to version 1.43

Until it gets fixed, this should solve the problem:

brew uninstall --ignore-dependencies pango
brew install iltommi/brews/pango

This will install this formula: https://github.com/iltommi/homebrew-brews/blob/master/pango.rb in which I replaced the v1.44 to 1.43

bibi
  • 3,671
  • 5
  • 34
  • 50
  • 2
    Excellent. I confirmed that this works as a workaround for now. – alexurba Sep 09 '19 at 13:13
  • I have to repeat this process every time another Homebrew formula wants to update pango – dersimn Apr 20 '20 at 09:35
  • 2
    One-line replacement for `brew upgrade`: `brew uninstall pango && brew upgrade && brew uninstall --ignore-dependencies pango && brew install iltommi/brews/pango` – dersimn Apr 30 '20 at 10:45
3

As of Aug. 24, 2020, the version of Pango on homebrew is 1.46.1 and this bug seems to have been fixed. Doing a clean installation of Gnuplot and Pango via homebrew should solve this problem.

yangl1996
  • 46
  • 3
1

Installing newer version Pango 1.45.5 seems to resolves the issue as well, please confirm:

brew uninstall --ignore-dependencies pango
brew install dersimn/craft/pango

Formula: https://github.com/dersimn/homebrew-craft/blob/master/Formula/pango.rb

dersimn
  • 805
  • 9
  • 15