Menu

#2397 Bad kerning with pngcairo and gnuplot 5.4.1

None
open-upstream-bug
nobody
2022-04-05
2021-01-14
No

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.

2 Attachments

Discussion

  • Bastian Märkisch

    • labels: --> Windows, pango
    • Group: -->
    • Priority: -->
     
  • Bastian Märkisch

    As far as I can tell, the pango version in the binary Windows release should be 1.46.1.

     
  • Bastian Märkisch

    • labels: Windows, pango --> Windows, pango, cairo
     
  • Bastian Märkisch

    It's getting worse. After updating MSYS2, pango is now at version 1.48.2. Results attached.

     
  • Ethan Merritt

    Ethan Merritt - 2021-06-11
    • status: open --> open-upstream-bug
     
  • Tatsuro MATSUOKA

    If I set the environment variablePANGOCAIRO_BACKEND=fc (fontconfig) it seems to be better.
    (Default backend is win32 for pangocairo on windows.)

     

    Last edit: Tatsuro MATSUOKA 2022-03-21
  • Vatsal Garg

    Vatsal Garg - 2022-04-05

    @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?

     
  • Tatsuro MATSUOKA

    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?

    echo %PANGOCAIRO_BACKEND%
    

    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

    # test2.gp
    set term pngcairo
    set output 'test.png'
    pl sin(x)
    set output
    

    From the cmd promt, execute

    set PANGOCAIRO_BACKEND=win32
    c:\Programs\gp543\bin\gnuplot test2.gp
    copy test.png test_win32.png
    set PANGOCAIRO_BACKEND=fc
    c:\Programs\gp543\bin\gnuplot test2.gp
    copy test.png test_fc.png
    
     

    Last edit: Tatsuro MATSUOKA 2022-04-05
  • Vatsal Garg

    Vatsal Garg - 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)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.