bugGNU Octave - Bugs: bug #49135, gnuplot: Default font must be set...

 
 

bug #49135: gnuplot: Default font must be set for "windows" terminal

Submitted by:  Rik <rik5>
Submitted on:  Mon 19 Sep 2016 10:39:28 PM UTC  
 
Category:  Plotting with gnuplot Severity:  2 - Minor
Priority:  2 Item Group:  None
Status:  Postponed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.2.0 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sun 02 Oct 2016 01:28:46 PM UTC, comment #11: 

Yes, but stable gets merged to default every few bug fixes, and it will also be merged to default after the 4.2.0 release.  Wait a few days and it will show up on the default branch.

Rik <rik5>
Project Administrator
Sun 02 Oct 2016 12:18:41 PM UTC, comment #10: 

It was fixed only on stable branch.

Avinoam Kalma <avinoam>
Project Member
Sun 02 Oct 2016 01:31:51 AM UTC, comment #9: 

I changed the defalt font to "Arial" rather thn "Helvetica" since that has a very good chance of existing on a Windows platform (http://hg.savannah.gnu.org/hgweb/octave/rev/fc9cd56986af).

I've changed the status to Postponed.  We can close this bug when it has been fixed upstream in gnuplot.

Rik <rik5>
Project Administrator
Tue 20 Sep 2016 09:03:43 AM UTC, comment #8: 

Sorry I have made a mistake to delete the gnuplot bug ticket.

I recreate it.

https://sourceforge.net/p/gnuplot/bugs/1860/

Sorry for repeatable post.

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 08:51:29 AM UTC, comment #7: 

I posted the gnuplot behavior to the gnuplot bug ticket.

https://sourceforge.net/p/gnuplot/bugs/1859/

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 08:12:23 AM UTC, comment #6: 

Sorry for many times posts

I wrote incorrect

set title "{/:Bold test^1}" font ",15"

does not give warnings.

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 08:03:34 AM UTC, comment #5: 

Using drawnow('windows', 'dummy', 'debug.gp')
I found title is drawn by like

set label "sqrt (abs (x y)) / (1 + x^2 + y^2)" (snip) font "Helvetica:Bold, 24"

So I tested on gnuplot 5.0.4 windows.

set title "test" font ":bold, 12"
plot x

No warnings appeared.

However, if title has enhanced specification like "^".

set title "test ^1" font ":bold, 12"
plot x

The above gave

Warning:  font ":bold" not available, trying "Arial" instead.
Warning:  font ":bold" not available, trying "Arial" instead.
Warning:  font ":bold" not available, trying "Arial" instead.
Warning:  font ":bold" not available, trying "Arial" instead.
Warning:  font ":bold" not available, trying "Arial" instead.

The situation was the same if I use syntax like the below

set title '{/:bold test ^1}' font ',20'

On wxt on windows,
warning appears regardless enhanced specification like "^".

I cannot judge weather the behaviors are bugs or features of gnuplot.
Anyway I will ask the above behaviors in the gnuplot mailing list.

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 06:54:40 AM UTC, comment #4: 

> The code that adds "-bold" to the font name exists but I cannot find it where it exists.
>On windows, windows and wxt terminal silently seems to
>set the default font and this add "-bold" gives warnings.


Sorry The above parts are my misleading.

Seeing the output of demo ezmesh 1, bold is used of plot title.

From the syntax gnuplot 5 for enhanced text,
one need not specify font name plot title to be bold

On gnuplot 5

set terminal windows
set title '{/:bold test}' font ',20'
plot x

Perhaps octave code can be changed to text to be bold etcs. without specifying font name using gnuplot 5 syntax.
But I do not know how to change the plotting code at this moment.

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 01:35:35 AM UTC, comment #3: 

> I executed fc-list embedded to octave for windows.
> Only fonts that exist in C:\windows\font was listed.


The above is incorrect. I used external gnuplot so that fontconfig setting depends on gnuplot's one.

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 01:25:41 AM UTC, comment #2: 

On cairo based terminals (including wxt) rely font setting on the fontconfig. Unlike unix based platform, each application has its own fontconfig setting on windows.

I executed fc-list embedded to octave for windows.
Only fonts that exist in C:\windows\font was listed.
This is the reason Helvetica is not accepted by cairo based terminals on windows. 

Tatsuro MATSUOKA <tmacchant>
Tue 20 Sep 2016 01:03:09 AM UTC, comment #1: 

If I set external gnuplot which has wxt terminal by gnuplot_terminal using octave-4.2.0-rc1 (not default branch but on alpha)

gnuplot_binary C:/Programs/gp504-64/bin/gnuplot.exe
setenv GNUTERM wxt
demo ezmesh 1

wxt terminal also outputs warnings.

(gnuplot.exe:2712): Pango-WARNING **: couldn't load font " bold, Not-Rotated 220"
, falling back to "Sans Not-Rotated 220", expect ugly output.

(gnuplot.exe:2712): Pango-WARNING **: couldn't load font " bold, 176", falling ba
ck to "Sans 176", expect ugly output.

(gnuplot.exe:2712): Pango-WARNING **: couldn't load font " bold, 220", falling ba
ck to "Sans 220", expect ugly output.

On qt terminal warnings do not appear.

Back to the windows terminal
warnings are

Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.
Warning:  font "-bold" not available, trying "Arial" instead.

However, even on windows terminal on octave-4.2.0-rc on alpha,

close all
plot (rand(3))

does not give any warning.

The code that adds "-bold" to the font name exists but I cannot find it where it exists.

On windows, windows and wxt terminal silently seems to
set the default font and this add "-bold" gives warnings.

   
Tatsuro MATSUOKA <tmacchant>
Mon 19 Sep 2016 10:39:28 PM UTC, original submission:  

The gnuplot "windows" terminal does not accept a blank fontname ("") without issuing a warning.  The other terminals correctly interpret the null string to mean gnuplot should select a default font.

Currently, Octave works around this with the following lines in _gnuplot_draw_axes_.m.

function [f, s, fnt, it, bld] = get_fontname_and_size (t)

  if (isempty (t.fontname) || strcmp (t.fontname, "*"))
    if (ispc ())
      fnt = "Helvetica";
    else
      fnt = "";
    endif
  else
    fnt = t.fontname;
  endif

The test used to check for a "windows" terminal is actually too generic (ispc).  However, the value of the gnuplot term variable is not currently available in this subfunction.

Evenutally, a better test should be worked out, or the terminal passed to this routine, so that Octave can avoid setting a font name that doesn't exist on terminals which CAN select an appropriate default font like "wxt".

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by tmacchant (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-17 mtmiller Release4.2.0-rc1 => 4.2.0
    2016-10-02 rik5 Severity3 - Normal => 2 - Minor
        StatusConfirmed => Postponed
    2016-09-19 rik5 Priority5 - Normal => 2

    Back to the top


    Powered by Savane 3.5