bugGNU Octave - Bugs: bug #52193, Font choices are ignored when...


bug #52193: Font choices are ignored when printing to an image file

Submitted by:  Etienne Dechamps <edechamps>
Submitted on:  Sun 08 Oct 2017 02:05:35 PM UTC  
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.2.1Operating System: GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

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


Sun 08 Oct 2017 03:05:49 PM UTC, comment #2:

Indeed, the only supported fonts are postscript fonts (Times, Helvetica, Courier). Any other choice will lead the print system to fallback to Helvetica.

This has been fixed on the development branch for "svg" output only.

Pantxo Diribarne <pantxo>
Project Member
Sun 08 Oct 2017 02:11:04 PM UTC, comment #1:

I realize that my original description might be a bit confusing. To clarify, there is no way (that I know of) to use a custom font when outputting to an image file using the 'fltk' or 'qt' toolkits. Neither set() not print(..., '-F...') work. When using gnuplot, they both work.

Etienne Dechamps <edechamps>
Sun 08 Oct 2017 02:05:35 PM UTC, original submission:

(Debian Sid, octave 4.2.1-4+b1)

With the 'gnuplot' graphics toolkit, one can choose the font to be used for print() by writing something like the following:

Or, alternatively:

In both cases, the image will be generated using the specified font.

When using the 'fltk' or 'qt' toolkits however, changing the font using set() works for window output, but not for print(), where the default font is always used. That's true at least for PNG and SVG.

In the SVG case it appears the "Helvetica" font is hardcoded in the XML that's being generated. One hacky workaround is to run this command on the SVG file after Octave is done generating it:

Obviously that won't work for PNG or any other raster image type, though.

Etienne Dechamps <edechamps>


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by edechamps (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Oct 2017 03:05:49 PM UTCpantxoStatusNone=>Confirmed

    Back to the top

    Powered by Savane 3.1-cleanup1