Menu

Cannot enable sans-serif fonts for "wxt" on Windows

Help
2023-03-16
2023-03-31
  • Daniel Dan K.

    Daniel Dan K. - 2023-03-16

    Hello,

    I've been using gnuplot on Windows for many years. Everything was fine until I installed gnuplot 5.4.6 on a new Windows 10 PC.

    There, I don't get sans-serif font in terminal "wxt". See attached image.

    I wonder why this is.

    I tried to set the font manually using
    set term wxt font "Sans"
    but this only triggered a message while plotting:
    "warning: problem determining pango font metrics."
    and results in a plot that is unusuable because large black chunks are covering the graph. I also tried "Arial" as font name, which is installed, according to Windows font settings:
    From the fonts shown on the screenshot, I can use "Alef" and "Caladea", but not "Bahnschrift" or "Arial".

    However, I see sans-serif font being used by term "qt".

    I'm at a loss. Please help. Thanks!
    Daniel

     

    Last edit: Daniel Dan K. 2023-03-16
  • Tatsuro MATSUOKA

    I cannot reproduce.
    "set terminal wxt font 'Sans'" or set terminal wxt font 'Sans-Serif'
    File attached.

    BTW
    On my Windows 10 and 11 PCs, I recently found "Microsoft Sanf Serif".

    Please see:
    https://superuser.com/questions/1512694/is-it-possible-to-alias-fonts-in-windows-10

    Before I found "Microsoft Sanf Serif", I used DejaVu Sans and its family fonts.
    https://dejavu-fonts.github.io/
    From Download on the site, you can download a font archive file. The zip format is convinient on Windows. Double click the zip file and open the folder anf go to "ttf" folder.
    Double click font files, you can install fonts.

    Altertively, if you install Libre Office, DevaVu Sans and its family fons are installed.

     
    👍
    1

    Last edit: Tatsuro MATSUOKA 2023-03-17
    • Daniel Dan K.

      Daniel Dan K. - 2023-03-21

      Dear Matsuoka-san,

      I found out why the terminal "wxt" can use "sans" fonts on one computer and fails to use them on another:

      If I set the display scaling to 250% (or higher), the above mentioned behaviour occurs.

      If I reduce the scaling below 250%, everything works as expected: "sans" font is used automatically, gnuplot issues no warnings.

      If you consider this a bug, I'll happily file a ticket.

      Best regards,
      Daniel

       
      • Tatsuro MATSUOKA

        Sans and Sans Serif themselves are not Windows fonts. I cannot guarantee that the fonts which are not registered in Windows font system display correctly. I think this is a font alias issue. If you use 'Microsoft Sans Serif' which exist on Windows, what happens if you use

        set terminal wxt font 'Microsoft Sans Serif'
        plot sin(x)
        
         

        Last edit: Tatsuro MATSUOKA 2023-03-22
        • Daniel Dan K.

          Daniel Dan K. - 2023-03-28

          Dear Matsuoka-san,

          I tried the commands. These are my observations:

          • Up to (and including) a display scaling of 225%, I see a "sans" font in the plot window.
          • With 250% display scaling, a "serif" font is used in the plot window.
          • With ** 300%** display scaling (which is the "recommended" value on my display), the plot is covered by huge letters and a warning message appears on the console.

          Please see the attached files for screenshots.
          Thanks.
          Daniel

           
          • Tatsuro MATSUOKA

            Hmm. I cannot test by myself because I do not have HR displays.
            One possible treatment is try to set the PANGOCAIRO_BACKEND envrionmental variable to "fc" (fontconfig) using the Windows setting feature.
            On Windows, the native pangocairo backend is win32.
            For other platforms the fontconfig is used for font handling.
            So please try the fontconfig backend.
            The win32 backend behaves worse than the fontconfig backend for the pngcairo terminals.
            See https://sourceforge.net/p/gnuplot/bugs/2512/

             

            Last edit: Tatsuro MATSUOKA 2023-03-29
            • Tatsuro MATSUOKA

              BTW, the issue should be treated as a bug. Can you post a bug ticket?

               
  • Tatsuro MATSUOKA

    Altertively, I add the fontconfig config file ant related files to the current 5.4.6 windows binary packages. New binary packages are available the gnuplot SF site.

    If you set the PANGOCAIRO_BACKEND variable to fc (fontconfig), you can use fontconfig backend rather than win32 backend on cairo related terminals incluiding the wxt terminal.

     
  • Daniel Dan K.

    Daniel Dan K. - 2023-03-30

    Dear MATSUOKA-san,

    I'll happily file a new bug on this topic.

    See here: https://sourceforge.net/p/gnuplot/bugs/2611/

     

    Last edit: Daniel Dan K. 2023-03-30
  • Daniel Dan K.

    Daniel Dan K. - 2023-03-30

    Strange, all earlier postings have been gone. I wonder why this discussion has been deleted.

    My screenshots are gone, also. To file a bug on this issue I planned to reuse text and screenshots from this thread. Now I would have to generate them from scratch. :-(

     

    Last edit: Daniel Dan K. 2023-03-30
  • Tatsuro MATSUOKA

    Yes, it is very strange. I have never experience such phenomena.

     
  • Daniel Dan K.

    Daniel Dan K. - 2023-03-31

    SF support team solved this issue. 👍

     

Log in to post a comment.

MongoDB Logo MongoDB