bugGNU Octave - Bugs: bug #44668, "fontname" is ignored...

 
 

bug #44668: "fontname" is ignored for OpenGL printing

Submitter:  Ben Abbott <bpabbott>
Submitted:  Mon 30 Mar 2015 01:30:06 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  pantxo
Originator Name:  Ben Abbott Open/Closed:  * Closed
Release:  * 3.8.2 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Apr 2015 06:50:20 PM UTC, comment #4: 

Thanks Ben, I pushed the patch here:
http://hg.savannah.gnu.org/hgweb/octave/rev/1929d9218ac0

Closing report.

Pantxo Diribarne <pantxo>
Group Member
Wed 01 Apr 2015 12:06:54 AM UTC, comment #3: 

I applied the patch to the stable branch and tried the script below.


plot (rand (3))
set (gca (), "fontname", "Courier")
print test1.pdf
set (gca (), "fontweight", "Bold")
print test2.pdf
set (gca (), "fontangle", "Italic")
print test3.pdf


In each case I got the desired result.

I didn't try applying to the default branch because building the default branch on MacOS 10.10 is currently broken.

Ben Abbott <bpabbott>
Group Member
Tue 31 Mar 2015 10:28:43 PM UTC, comment #2: 

I attached a patch that fixes the issue for me and also adds support for bold an italic fonts in printed output.


(file #33501)

Pantxo Diribarne <pantxo>
Group Member
Mon 30 Mar 2015 02:43:33 PM UTC, comment #1: 

Hi Ben,

The gl2ps utility only supports a few fonts [1], i.e. those that are "guaranteed to be available to the viewer application". Our implementation substitutes any unsupported font by Helvetica.
In this case, the problem is that Octave expects lowercase and thus doesn't recognize "Courier" as it expects you to write it "courier". I'll fix this by lowercasing the fontname before comparison with supported fonts.

If I replace "Courier" by "courier" in your example the eps actually uses courier font. The workaround is thus to use lowercase fontnames among "courier", "times-roman" (or "times"),"zapfdingbats" or "symbol".

[1] http://geuz.org/gl2ps/#tthFtNtAAC

Pantxo Diribarne <pantxo>
Group Member
Mon 30 Mar 2015 01:30:06 PM UTC, original submission:  

All the text produced by simple script below


plot (rand (3))
set (findall (gcf (), "-property", "fontname"), "fontname", "Courier")
print -depsc test.eps


are Helvetica


(0) 69.8755 47.52 12 /Helvetica SCR
(0.2) 69.8755 117.936 12 /Helvetica SCR
(0.4) 69.8755 188.352 12 /Helvetica SCR
(0.6) 69.8755 258.768 12 /Helvetica SCR
(0.8) 69.8755 329.184 12 /Helvetica SCR
(1) 69.8755 399.6 12 /Helvetica SCR


I'm running 3.8.2 on Mac OS 10.10 (Yosemite). I expected this problem also exists for the development branch. Unfortunately, I'm presently unable to build the default branch, so I've marked this as a bug for 3.8.2.

In the event that others get a different result, I've attached my eps-file.

Ben Abbott <bpabbott>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33501:  fix_printfonts.patch added by pantxo (2KiB - text/x-diff)
file #33490:  test.eps added by bpabbott (6KiB - application/postscript)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by bpabbott (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-02 pantxo StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-03-31 pantxo Attached File- Added fix_printfonts.patch, #33501
    2015-03-30 pantxo StatusNone Confirmed
        Assigned toNone pantxo
    2015-03-30 bpabbott Attached File- Added test.eps, #33490

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code