Dear gnuplot developers,
first, many thanks for this great tool!
Running gnuplot 5.4 pl 3 (gp543-win64-mingw.exe) on Windows 10, I found a strange behaviour when using pngcairo terminal: In Key, labels and numbers on x and y axis, the uppermost pixel is missing. So a "T" looks like a "I".
Find attached a minimal demo script and its output file.
The effect can also be seen here:
https://sourceforge.net/p/gnuplot/bugs/2048/#5e0c/80c2/fe06 in the "gp467win_Arial.png" (see ylabel)
Many thanks in advance,
Frank
I can reproduce the same effect on the gnuplot 5.4.3 on windows but do not reproduce on 5.4.3 on cygwin. On 5.5.0 on windows (development snapshot on 2022-03-16). the result is slightly different but the effect remains.
Last edit: Tatsuro MATSUOKA 2022-03-17
Gnuplot and many other applications are innocent bystanders suffering from a development meltdown in the pango project, which cairographics uses (or at least used to, I'm not sure what the plan is going forward). Basically pango versions 1.44 and onwards have lost the ability to render many old fonts correctly. The exact symptoms depend on screen dpi, antialiasing settings, hinting level, and the nature of the font involved. Too complicated for me to sort out other than to suggest trying a different font or a different version of your pango library.
See extensive set of links with more information attached to Bug #2397
https://sourceforge.net/p/gnuplot/bugs/2397/
I have tested on gnuplot-5.5.0 (2022-03-16) with pango-1.43.0 (built myself) on windows. Snapshot is attached. The pango version is less than 1.44 but upper left "T" of "Test" is lack of top and "-0.2" , "-10", "-5" and "10" were not represented properly.
Representation is surely affected by the pango version but mere downgrade pango version may not be a work around.
Last edit: Tatsuro MATSUOKA 2022-03-21
Dear Ethan,
many thanks for the explanation. My Win-Laptop does not suffer from this problem, only my desktop PC does. Maybe I can find a difference between the two installations.
Dear Tatsuro,
thanks for your support!
Best wishes,
Frank
After some googling I found the setting of the PANGOCAIRO_BACKEND enviroment variable. If I set
PANGOCAIRO_BACKEND=fc
, Figure.png by your script on gnuploy 5.4.3 on windows gives the attached one (seem to be good). This is one of the work around at the moment.(By default pangocairo on windows uses the win32 backend but not the fontconfig backend. PANGOCAIRO_BACKEND enviroment variable can chage the backend on windows. On linux and mac(?), fontconfig backend is used .
see https://sourceforge.net/p/gnuplot/bugs/2121/#a5bb/3758/355d)
Dear Tatsuro,
thank you very much! The workaround works perfect fine!
Best wishes,
Frank
Thank you Tatsuro for this workaround.
I noted more issues with both variants, while using gnuplot 5.4.6.
I am using:
The
dpi=96
output forset PANGOCAIRO_BACKEND=win32
(akafigure_dpi-96_win32_v5.4.6.png
) looks similar to those posted above, having cut-off errors in the labels. Note that the title is affected as well, while the key (or legend) seems to be fine.The
dpi=96
output forset PANGOCAIRO_BACKEND=fc
(akafigure_dpi-96_fc_v5.4.6.png
) looks good at the labels, but note the cut off in the legend and in the title as well.At higher resolutions,
dpi=240
, these errors become less evident. I only see a cut off in the title when usingset PANGOCAIRO_BACKEND=win32
(which is the same as the defaultset PANGOCAIRO_BACKEND=
).PS: An annoying error message appears beginning with gnuplot version 5.4.4 when using
set PANGOCAIRO_BACKEND=fc
:which should be a warning instead of error, since it seems to work properly, or does not appear at all.
I have confirmed what you showed.
On Cygwin and Ubuntu, even if dpi is 96, output has no cut off.
I attached the file.
Windows specific treatment should be required.
For the warning, the config file and related files for fontconfig is not attached to the binary pacakge even if qt anf gd uses fontconfig
Please use etc.zip, place "etc" folder at the same level as "bin" folder.
I will consider I will inciude etc folder and its content to the binary package.
BTW, the easilst way to get the verion in gnuplot sciprt is to use GPVAL_VERSION and GPVAL_PATCHLEVEL.
Last edit: Tatsuro MATSUOKA 2023-03-11
Thanks at lot, your
etc.zip
works fine.BTW: I am aware of
sprintf()
, but decided not to usesprintf("%.1f", GPVAL_VERSION)
, since it will break when the minor version becomes greater 10, i.e. 5.11+.The minor version will not get that high; the next major release will be 6.0 rather than 5.6
I tested qt and the gd terminals png, jpeg and gif without the etc/ directory, they do not produce the error message "Fontconfig error: Cannot load default ...".
However, as etc/ seems to remove the error message for the other terminals when the pango/cairo backend is changed, please include etc/ in the next windows binary package.