Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnuplot graphs have garbled text on Mac OS/homebrew #24

Closed
gregs1104 opened this issue Aug 30, 2020 · 2 comments
Closed

gnuplot graphs have garbled text on Mac OS/homebrew #24

gregs1104 opened this issue Aug 30, 2020 · 2 comments
Assignees

Comments

@gregs1104
Copy link
Owner

In July 2019 pgbench-tools merged PR #15 which switched to using gnuplot's pngcairo output "terminal", to use gnuplot's terminology. This improves the quality of graphs compared to the basic png output. In July 2020, I noticed that output stopped working correctly under the gnuplot chain distributed by the Mac homebrew tool. The text of the labels is corrupted, with successive characters overwriting each other. It's easy to test for the problem:

$ gnuplot
set output "test.png"
set term pngcairo
plot sin(x)
quit
$ open test.png

And I'm attaching a sample. Commit a81305c gave a workaround for the problem, which is simply to switch back to set term png and lose some graphics quality.

The problem appears resolved for both OS X Mojave and Catalina after this update:

$ brew update && brew upgrade
...
Updated Homebrew from 5de4378a9 to 7eb1a0969.

The versions of gnuplot and cairo didn't change between those two commits. This makes me think it was a typography library bug, in a lower level drawing package; maybe freetype? I'm still bisecting a root cause, mainly to defend against a future regression now that it's fixed. I'll document a bit further and revert the workaround once I'm satisfied with this issue report.
broken

@gregs1104 gregs1104 self-assigned this Aug 30, 2020
@gregs1104
Copy link
Owner Author

Confirmed the bug was gone on a third Mac. Homebrew was updated to here:

Homebrew/homebrew-core (git revision 097f65; last commit 2020-08-30)
Homebrew/homebrew-cask (git revision 132569; last commit 2020-08-30)

Out of the packages gnuplot directly depends on, only two were updated since the bug was introduced:

/usr/local/Cellar/freetype/2.10.1 (61 files, 2.2MB) *
  Poured from bottle on 2020-02-29 at 11:21:18
--->  One rev update, 2.10.1 -> 2.10.2
/usr/local/Cellar/freetype/2.10.2 (61 files, 2.3MB) *
  Poured from bottle on 2020-08-30 at 17:20:12

No brew change to that one, just grabbed latest rev 2.10.2: https://sourceforge.net/projects/freetype/files/freetype2/2.10.2/ The only fix that seems in the right neighborhood is "Function `FT_Get_Var_Axis_Flags' returned random data for Type 1 MM fonts."; I don't know that any of the fonts I'm using are Type 1 Multi-Master, but perhaps that is the issue and why not everyone ran into it.

glib was also updated:

/usr/local/Cellar/glib/2.64.3 (436 files, 15.7MB) *
  Poured from bottle on 2020-06-23 at 10:39:46
--->  Two rev updates, 2.64.3 -> 2.64.4 -> 2.65.5
/usr/local/Cellar/glib/2.64.5 (436 files, 14.8MB) *
  Poured from bottle on 2020-08-30 at 17:20:27

Those changes seem below where the bug was happening. 2.65.5: https://gitlab.gnome.org/GNOME/glib/-/commit/f91af2021ca4e0cef2fc0e2ef188958b3d590681

gregs1104 added a commit that referenced this issue Aug 31, 2020
Improve look on Mac graphs now that I can.
@gregs1104
Copy link
Owner Author

gregs1104 commented Aug 31, 2020

Done with this after last commit. I'm keeping this open so it's more likely people will find it. I'll close it in a few months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant