bugGNU Octave - Bugs: bug #36052, Incorrect font in eps output...

 
 

bug #36052: Incorrect font in eps output produced by the gnuplot backend

Submitter:  None
Submitted:  Sat 31 Mar 2012 10:40:56 AM UTC
   
 
Category:  Plotting with gnuplot Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Moreno Marzolla Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 24 Jan 2014 08:36:01 PM UTC, comment #2: 

No response on this bug, closing as won't fix, opinion of what the default configuration should be. Feel free to follow up on this report or report another bug if you believe this issue has not been resolved.

Mike Miller <mtmiller>
Group Member
Tue 24 Apr 2012 12:14:52 PM UTC, comment #1: 

The following configuration in your octaverc would solve the problem for you:


set(0, 'defaultaxesfontname', 'Helvetica');
set(0, 'defaultaxesfontsize', 10);


Substitute whatever settings you like as your defaults.

I looked into this at some length for a different problem and came across the same line causing the problem for me.  See

http://octave.1599824.n4.nabble.com/3-6-1-produces-eps-files-that-are-unusable-on-Debian-wheezy-td4438420.html

I don't think we never came to a consensus in that thread on whether this should be changed in Octave or not.  I think the question is whether Octave should be in charge of setting a valid default font or whether it should be left to ghostscript to select the default font.

Mike Miller <mtmiller>
Group Member
Sat 31 Mar 2012 10:40:56 AM UTC, original submission:  

Consider the following code snipped:


set(gcf,"paperorientation","landscape");
papersize=[5 4] * 0.85;
margin=[0 0];
set(gcf,"papersize",papersize);
set(gcf,"paperposition", [margin papersize-margin*2]);
plot([1:10],[1:10],";Foobar;");
xlabel("Foo");
ylabel("Bar");
title("Foobar plot");
print("plot.eps","-depsc2","-debug");


Using octave 3.2.3 (ubuntu 10.04), the gnuplot backend produces the attached file plot.eps.correct, which is correct.

The same script with octave 3.6.1 (manually compiled from the tarball available at octave.org) produces the attached file plot.eps.wrong: note that the font used for title and axis labels is courier instead of helvetica.

By looking at octave-print-commands.log, I observe that Octave 3.2.3 outputs something like:


set title "Foobar plot" font ",12" enhanced;
set xlabel "Foo" textcolor rgb "#000000" font ",12" enhanced rotate by 0.000000;
unset x2label;
set ylabel "Bar" textcolor rgb "#000000" font ",12" enhanced rotate by 90.000000;


wihle Octave 3.6.1 outputs something like:


set title "Foobar plot" font "{},20" enhanced;
set xlabel "Foo" textcolor rgb "#000000" font "{},20" enhanced rotate by 0.000000;
unset x2label;
set ylabel "Bar" textcolor rgb "#000000" font "{},20" enhanced rotate by 90.000000;


I believe that the problem lies in the font specification


font "{},20"


To fix the wrong font name, the following workaround may work (it seems to work in this specific case, I am not claiming it is the correct fix to this problem): in scripts/plot/private/__go_draw_axes__.m, around line 2231, replace


function [f, s, fnt, it, bld] = get_fontname_and_size (t)
  if (isempty (t.fontname) || strcmp (t.fontname, "*"))
    fnt = "{}";
  else
    fnt = t.fontname;
  endif


with


function [f, s, fnt, it, bld] = get_fontname_and_size (t)
  if (isempty (t.fontname) || strcmp (t.fontname, "*"))
    fnt = "";
  else
    fnt = t.fontname;
  endif


Using the patch above, Octave 3.6.1 produces the attached file plot.eps.better, which looks better.

The font is a bit large, but this is not a bug (I actually prefer larger fonts since labels are more readable using the default plot size). The font can be manually reduced using:


print("plot.eps","-depsc2","-F:6","-debug");


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25528:  plot.eps.wrong added by None (22KiB - application/octet-stream)
file #25529:  plot.eps.better added by None (22KiB - application/octet-stream)
file #25527:  plot.eps.correct added by None (22KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-24 mtmiller StatusNone Wont Fix
        Open/ClosedOpen Closed
    2012-03-31 None Attached File- Added plot.eps.correct, #25527
        Attached File- Added plot.eps.wrong, #25528
        Attached File- Added plot.eps.better, #25529

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code