On Windows 10, I upgraded gnuplot from 5.2.8 to 5.4.1 and I noticed that with the latter there is something wrong with the spacing between characters, with the pngcairo terminal.
set terminal pngcairo font "Arial,12" version = system('gnuplot --version') version = word(version, 2).'.'.word(version,4) set title '000001111122222' set format x "%.3f" set format y "%.3f" set xlabel '000001111122222' set ylabel '000001111122222' set output 'kerning_'.version.'.png' plot sin(x)
Compare the two attached files. In particular, notice the spacing between the zeroes in "10.000", on the bottom right. The kerning is clearly better in version 5.2.8. All the strings on the plot seem to be affected.
This problem occurs whether I specify the font or not.
This is the first report I recall from the Windows side, but it is highly likely you are seeing fallout from breakage in the upstream pango libraries. So far as I know this is an ongoing problem due to (IMHO) poor decisions upstream. Changing to a different (newer or older) version of the pango and/or harfbuzz libraries may fix it. You can find more information here:
Previous gnuplot reports:
https://sourceforge.net/p/gnuplot/bugs/2194/
https://sourceforge.net/p/gnuplot/bugs/2048/
See also:
https://stackoverflow.com/questions/62992375/overlapping-letters-in-tics-and-labels-gnuplot-5-4
https://stackoverflow.com/questions/57698204/gnuplot-pdf-terminal-exhibits-font-issues-on-mac
https://github.com/harfbuzz/harfbuzz/issues/2394#issuecomment-626254448
https://gitlab.gnome.org/GNOME/libgxps/-/merge_requests/1
https://gitlab.gnome.org/GNOME/libgxps/-/merge_requests/1/diffs?commit_id=3b57ea41f746f7dc8172eea7a43e18f58079c5ed
Thank you for your reply and the links. In one of those links, I've found the following comment:
https://stackoverflow.com/a/63564204/12424992
Would it be possible to incorporate this newer version of pango into gnuplot? That is, if it actually solves the problem. I don't know how to test this myself.
As far as I can tell, the pango version in the binary Windows release should be 1.46.1.
It's getting worse. After updating MSYS2, pango is now at version 1.48.2. Results attached.
If I set the environment variable
PANGOCAIRO_BACKEND=fc
(fontconfig) it seems to be better.(Default backend is win32 for pangocairo on windows.)
Last edit: Tatsuro MATSUOKA 2022-03-21
@tmacchant3 How do I go about setting the environmental variable? I have tried going to Control Panel → System → Advanced → Environmental Variables and created a global variable PANGOCAIRO_BACKEND and set its value to fc
However, the kerning issue still persisted. I didn't face a similar issue in version 5.2.8. Do you think that I should revert to that version before this issue is fixed?
Hmm
Control Panel → System → Advanced → Environmental Variables and created a global variable PANGOCAIRO_BACKEND and set its value to fc
The above is correct.
Can you confirm by executing the below that PANGOCAIRO_BACKEND value is "fc" on the cmd.exe or the power shell?
From some reason I do not use global Environmental Variables setteing.
Temporal setting of Environmental Variable can be carried out by 'set' commad.
The below is one example.
Script
From the cmd promt, execute
Last edit: Tatsuro MATSUOKA 2022-04-05
Thanks @tmacchant3. It worked.
What I did earlier was to change the environmental variable after installing gnuplot. But now I changed the environmental variable before installing and there are no font issues as such (atleast for now XD)