bugGNU Octave - Bugs: bug #40158, FontUnits property only works for...


bug #40158: FontUnits property only works for "points"

Submitted by:  Rik <rik5>
Submitted on:  Wed 02 Oct 2013 04:45:20 AM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

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)

Tue 26 Aug 2014 05:09:25 AM UTC, comment #7:

I agree, your patch seems to be working correctly. I used

Which I would think would produce a figure that is ~1 inch since a point is 1/72 of an inch, but of course this comes out as 1/2 inch.

Other renderers also seem to have some mysterious factor. I used KDE's font previewer and at 72 point an 'M' is still not an inch.

I guess I'm willing to say that the Octave part of this bug is fixed, and I don't know about fixing the rest.

Rik <rik5>
Project Administrator
Mon 25 Aug 2014 09:01:34 PM UTC, comment #6:

In your example script, if I retrieve the hidden property "fontsize_points", I obtain 72 which is the expected result. This property is now used both by the on-screen renderer and gl2ps.

In the patch I have assumed that txt-renderer expected the font size to be in points units (the only way it used to work), but it maybe in pixels or something ... anyways it's not obvious.

The following script

returns 100.9 pixels/inch on my computer which is not enough to explain the factor of 2 we observe.

Pantxo Diribarne <pantxo>
Project Member
Sun 24 Aug 2014 10:48:47 PM UTC, comment #5:

I wonder if there isn't a problem with the conversion routine (not your code). If I execute the following code, I expect to see an 'M' figure which is nearly 1" large. Instead, it is almost exactly 0.5" large. Printing, however, works alright.

Rik <rik5>
Project Administrator
Sun 24 Aug 2014 08:25:29 PM UTC, comment #4:


I have pushed the patch at http://hg.savannah.gnu.org/hgweb/octave/rev/1288a2f27769

If there is no objection I'll close this bug report in the next coming days.

Pantxo Diribarne <pantxo>
Project Member
Sun 03 Aug 2014 08:14:58 AM UTC, comment #3:

@Rik: I had the intension to check it again and push it when I am back from vacations (2 weeks ago). If you have time to check it then it's even better.

Pantxo Diribarne <pantxo>
Project Member
Sun 03 Aug 2014 06:45:32 AM UTC, comment #2:

@Panxto: Should your patch be applied?

Rik <rik5>
Project Administrator
Sun 11 May 2014 09:01:41 PM UTC, comment #1:


I attached a patch:

  • it introduces a new hidden property "fontsize_points" (for axes and text) for which a custom get_fontsize_points method was already in place (but unused).
  • most part of the conversion/update work was already in place for axes so I borrowed code from there for text objects.

(file #31361)

Pantxo Diribarne <pantxo>
Project Member
Wed 02 Oct 2013 04:45:20 AM UTC, original submission:

The following code should use inches for the fontunits which should create something very large. Instead, the "FontSize" property is always interpreted in points.

Rik <rik5>
Project Administrator


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

Attach Files:

Attached Files
file #31954:  M.png added by rik5 (17KiB - image/png)
file #31361:  update_fontunits.patch added by pantxo (6KiB - application/x-download)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -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.


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



    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Tue 26 Aug 2014 05:09:25 AM UTC rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    Sun 24 Aug 2014 10:49:20 PM UTC rik5 Attached File- => Added M.png, #31954
    Sun 24 Aug 2014 08:25:29 PM UTC pantxo StatusNone => Ready For Test
    Sun 11 May 2014 09:01:41 PM UTC pantxo Attached File- => Added update_fontunits.patch, #31361

    Back to the top

    Powered by Savane 3.3