bugGNU Octave - Bugs: bug #55328, loglog plots have clipped...


bug #55328: loglog plots have clipped exponents for labels of x and y axes

Submitter:  Rik <rik5>
Submitted:  Sun 30 Dec 2018 06:47:33 AM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 5.0.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Mon 31 Dec 2018 05:52:17 PM UTC, comment #7: 

Looks good.  I pushed the cset here https://hg.savannah.gnu.org/hgweb/octave/rev/45cf2ada3e39.

Closing report here and on the 5.0 Bug Fix List.

Rik <rik5>
Project Administrator
Mon 31 Dec 2018 05:09:06 PM UTC, comment #6: 

I attached an updated patch with a log an a comment. I could not see any visible downside.

(file #45816)

Pantxo Diribarne <pantxo>
Project Member
Mon 31 Dec 2018 03:25:35 PM UTC, comment #5: 

There is no reaason to fix it for Verdana--I can always choose another font--but if it is a problem with a very common font like Roboto that would be more of a problem.  People would blame Octave, rather than their font libraries, for the bad display.

There may be some theoretical justification for increasing the bounding box by 1 pixel.  I'm sure the internal calculations, probably done in points, have to be converted to pixels by way of the monitor DPI.  This may lead to various round-off errors where we truncate instead of using ceil() or round().

Anyways, the patch works for me.  What is the downside?

Rik <rik5>
Project Administrator
Mon 31 Dec 2018 11:39:27 AM UTC, comment #4: 

Systematically increasing the bbox height by one pixels makes things work for both Verdana and Roboto but I have no real justification for it:

--- a/libinterp/corefcn/ft-text-renderer.cc     Sun Dec 30 11:58:56 2018 -0800
+++ b/libinterp/corefcn/ft-text-renderer.cc     Mon Dec 31 12:36:38 2018 +0100
@@ -663,7 +663,7 @@
         Matrix& bb = line_bbox.back ();
         bb(1) = m_ymin;
-        bb(3) = m_ymax - m_ymin;
+        bb(3) = (m_ymax + 1) - m_ymin;
         if (m_deltax > 0)
           bb(2) += m_deltax;

Pantxo Diribarne <pantxo>
Project Member
Mon 31 Dec 2018 11:23:34 AM UTC, comment #3: 

@Rik: Confirmed with Verdana font and also with Roboto. Verdana is known to cause problems both in linux and Windows (see bug #49216). I don't know if it is due to the font itself or to the way Octave uses FreeType: IIRC Dmitri reported some kerning issues with Roboto (modern widespread font) so that's probably something wrong in Octave.

Pantxo Diribarne <pantxo>
Project Member
Mon 31 Dec 2018 02:24:00 AM UTC, comment #2: 

@Pantxo: I am using Verdana as the font and a fontsize of 10.  Changing either of those two items makes it work.  For example, if I use "Arial" or change the fontsize to 12.  This may simply mean that Verdana is not a well-hinted font for FreeType.  If that is the case, I am happy to close this report.

When I print the plot it looks fine.  It is only onscreen display that is bad.  I've attached a screenshot taken with a screen magnifier.

Rik <rik5>
Project Administrator
Sun 30 Dec 2018 09:09:48 PM UTC, comment #1: 

@Rik: I can't reproduce, but I do have seen such clipping while working on this. I attached a screenshot of what I obtain (on linux Mint 19). Note that the x-extent of the title is much narrower than yours. Are you using some specific defaults for font properties? Can you attach a high resolution printed output, e.g. "print -r300 loglog.png"?

Pantxo Diribarne <pantxo>
Project Member
Sun 30 Dec 2018 06:47:33 AM UTC, original submission:  


demo loglog 1

The resulting screen capture is attached.  It shows that the exponents used for the X and Y labels are clipped.  This is likely to be caused by an incorrect calculation of the y extent property.

@Pantxo: I added you to the CC list because I think this bug may be related to your work on calculating text extents.

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 #45816:  ftfont7.patch added by pantxo (991B - text/x-patch)
file #45804:  loglog_zoom.png added by rik5 (12KiB - image/png)
file #45796:  loglog_px.png added by pantxo (36KiB - image/png)
file #45784:  loglog.png added by rik5 (17KiB - image/png)


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)
  • -email is unavailable- added by rik5

    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 project members can vote.





    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-31 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-12-31 pantxo Attached File- Added ftfont7.patch, #45816
        StatusConfirmed Patch Submitted
    2018-12-31 pantxo StatusWorks For Me Confirmed
    2018-12-31 rik5 Attached File- Added loglog_zoom.png, #45804
    2018-12-30 pantxo Attached File- Added loglog_px.png, #45796
        StatusNone Works For Me
    2018-12-30 rik5 Attached File- Added loglog.png, #45784
        Carbon-Copy- Added pantxo

    Back to the top

    Powered by Savane 3.9