I'm using gnuplot 5.2.7
G N U P L O T Version 5.2 patchlevel 7 last modified 2019-05-29
with wxt terminal and any plot has labels completely messed up as seen in screenshot after a simple plot sin(x)
This probably happened afeter latest update of wxt: I'm on OSX using wxmac 3.0.4
this can be tested by installing gnuplot via this brew recipe:
https://github.com/iltommi/homebrew-brews/blob/master/gnuplot.rb
vai the simple command
brew install iltommi/brews/gnuplot
(the normal brew core gnuplot package removed wxt some time ago...)
I posted an issue on the wxwidgets tracker https://trac.wxwidgets.org/ticket/18480 but it seems to be connected more to cairo/pango
In fact if I recompile using 1.43 and not 1.44 of pango, everything is ok
So I submitted a bug report on pango gitlab...
https://gitlab.freedesktop.org/cairo/cairo/issues/373
Last edit: tom 2019-08-30
Do you see this same problem with the other cairo-based terminals? The wxt pngcairo and pdf terminals all share the same code for text layout.
If so, I wonder if it may be related to a deliberate change in pango to use harfbuzz rather than cairo to obtain font metrics:
https://github.com/harfbuzz/harfbuzz/issues/1892
The issue you see is not exactly the same as the one reported there, but they both result from incorrect reported font metrics.
On the other hand if you see this problem only with wxt and not with pngcairo or pdf, then something else must be involved. In particular please use the wxt plot window tool widget to change the hinting contribution. I gather from the linked discussion above that harfbuzz does not understand hinting, so maybe that is a clue?
Last edit: Ethan Merritt 2019-08-30
I can confirm that the same problem occurs for the Cairo-based terminals. So your suspicion Pango is the reason seems correct.
(I also posted a question on Stackoverflow that brought me here: https://stackoverflow.com/questions/57698204)
Followup: I posted an issue on the right pango gitlab: https://gitlab.gnome.org/GNOME/pango/issues/422
[from pango gitlab issue report]
Can someone confirm this happens only on macos?
Could someone test wxt terminal on linux using latest pango v1.44.6 ?
I have lib64pango1.0_0-1.44.6-1.mga8 on Mageia (Cauldron) linux.
No evident problems with fonts for the wxt terminal here.
I could get rid of the artifact by changing line 84 of
src/wxterminal/gp_cairo.h
setting
GP_CAIRO_SCALE
to1
rather than20
Could this help in pinning down the problem?
(I'm no more sure it's an upstream bug)
@sfeam : a gentle bump on this: would the
GP_CAIRO_SCALE
fix above mean that it's not an upstream bug?So far as I can tell this is a slow-moving train wreck upstream. See discussion here:
https://github.com/harfbuzz/harfbuzz/issues/2394#issuecomment-626254448
I really don't know what is going to come out of this moving forward. It seems that the primary developers have decided that it is more important to support new fonts on extremely high-resolution displays than it is to support old fonts on what you and I would consider a "normal" display. Maybe upstream distros will fork and maintain an older (working) version of pango? Maybe they will at least provide a list of supported vs unsupported fonts? Maybe some backwards-compatibility setting will be added to the library?
My understanding of the detailed nature of this problem is limited. I gather it is largely due to harfbuzz not handling hinting. So perhaps disabling hinting would fix or improve things for you, a considerably less drastic change than degrading the resolution by 20-fold. Since I don't see the problem here I can't usefully experiment.
Meanwhile if I follow the trail of your earlier bug report to cairo->pango I see that other projects are reporting the same sort of errors from pango 1.44 on OSX:
https://gitlab.gnome.org/GNOME/librsvg/-/issues/520#note_627033
So yes, it's an upstream problem. Possibly we could work around it be turning off hinting, but that would have to be explored by someone who is seeing the problem. Can you do the experiment? What happens if you replace hinting = 100 with hinting = 1 everywhere in
.../term/cairo.trm
and.../src/wxterminal/gp_cairo.c
? Or maybe even hinting=0 ?Last edit: Ethan Merritt 2020-06-02