bugGNU Octave - Bugs: bug #48567, superscripts spaced incorrectly in...

 
 

bug #48567: superscripts spaced incorrectly in text objects (OpenGL toolkit)

Submitted by:  Rik <rik5>
Submitted on:  Tue 19 Jul 2016 11:32:28 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 3 - LowItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

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 Jump to the original submission)

Fri 22 Sep 2017 01:52:30 PM UTC, comment #13:

Thank you both of taking care of the review. I noticed a regression (see black polygon in e.g. demo title 3) which I fixed with this patch:

http://hg.savannah.gnu.org/hgweb/octave/rev/71a449b29cc7

Pantxo Diribarne <pantxo>
Project Member
Fri 22 Sep 2017 12:08:20 AM UTC, comment #12:

This change caused a BIST test to fail in _osmesa_print_. The expected value of the generated file is different after the tweaks to exponents. I fixed that here (http://hg.savannah.gnu.org/hgweb/octave/rev/35d13d84a71a).

Rik <rik5>
Project Administrator
Thu 21 Sep 2017 11:20:43 PM UTC, comment #11:

I was the original reporter and this works very nicely now on my original code. Thanks to Pantxo for keeping on top of this. Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Thu 21 Sep 2017 10:05:27 PM UTC, comment #10:

I made some minor edits and pushed the changeset from file #41709 here:

http://hg.savannah.gnu.org/hgweb/octave/rev/1b7e49a72c62

Can we close this report, or is there more to be done? If there is more, should we continue here or in a separate report?

John W. Eaton <jwe>
Project Administrator
Fri 01 Sep 2017 01:29:36 PM UTC, comment #9:

I attached an updated patch since the previous ones did not apply anymore.

(file #41709)

Pantxo Diribarne <pantxo>
Project Member
Sun 04 Jun 2017 01:02:04 PM UTC, comment #8:

@Rik: do you think you'll get a chance to test this patch.

Pantxo Diribarne <pantxo>
Project Member
Mon 20 Mar 2017 11:55:39 AM UTC, comment #7:

Hi,

I attached a preliminary cset that implements manual positioning of text characters in both svg and eps formats. This currently covers all the formats that we use since the pdf terminal in gl2ps is only used without text (latex handles the text).
Could you please test it when you have time?

I didn't go further with svg conversion since I now think Batik is not reliable enough (fonts location configuration is a mess, "Symbol" font not found by default ...).

(file #40032)

Pantxo Diribarne <pantxo>
Project Member
Tue 11 Oct 2016 08:31:32 PM UTC, comment #6:

I am much more concerned about text rendering than lines transparency, so I didn't review the converters capabilities in this regard. Anyway we definitely only have few (one?) candidates:

  • Batik handles text attributes very well and has a good PDF printout (EPS receives much less attention and e.g. transparency is not supported), provided FOP is properly configured to find fonts on the system. This would be a good candidate for svg->pdf->qhostscript chain.
  • Qt 4.8 only has builtin support for a subset of svg and can't read gl2ps svg files out of the box, clipping areas are drawn black and have to be removed. Besides this I saw font rendering issues and some polygons outlined when they should not but to be fair, I should test all this with Qt5.
  • Inkscape is full featured and its outputs are superior to others and it would even eliminate the need for ghoscript. Unfortunately it is monolithic, which rules it out in my opinion.
  • librsvg has poor text capabilities, e.g. it doesn't handle individual character coordinates which are used in the patch I provided.

At the end of the day we only have Batik as a serious candidate. It adds a (java)step in the chain but the timing is not as bad as I though:

For svg with many patches it is about only +20%, while for simple plots it is about a 100% penalty.

As a first step I'd propose to first implement a few new print devices, e.g. -dbatikpdf(eps,png), compare the png output with the current one using dump_plot_demos and then decide to go further or not. The advantage of this approach is that we would require users to have Batik and Fop properly installed and configured and not have to handle this dependency ourselves for the moment.

Pantxo Diribarne <pantxo>
Project Member
Tue 11 Oct 2016 02:47:17 PM UTC, comment #5:

I like the idea. It would be nice to switch the backend to svg so we could also get alpha transparency, in addition to better text formatting.

Rik <rik5>
Project Administrator
Tue 11 Oct 2016 01:52:04 PM UTC, comment #4:

I attached a draft cset that improves the text in svg printout: it dumps a preformated svg text element directly in gl2ps output. It allows us two important imprvements:

  • placing characters exactly where they should be (i.e. consistently with onscreen result)
  • use any font present on the system

I also a toy octave function "svg2other" that uses Java Batik and FOP to convert the svg to pdf/eps or png. In order to use this function you need to install FOP and Batik, and eventually change the path to the .jar binaries in the function.

(file #38701, file #38702)

Pantxo Diribarne <pantxo>
Project Member
Fri 22 Jul 2016 01:08:22 AM UTC, comment #3:

I've marked the bug as "Postponed". Maybe we'll get to this, or maybe we'll just wait for improvements in gl2ps to come along.

Rik <rik5>
Project Administrator
Thu 21 Jul 2016 01:02:59 PM UTC, comment #2:

I marked the bug confirmed but I would be tempted to mark it "Won't fix".

Pantxo Diribarne <pantxo>
Project Member
Thu 21 Jul 2016 01:01:16 PM UTC, comment #1:

Unfortunately, as explained in comment 72 of bug #31468, the approach we use to display multi-line and tex formatted strings is very fragile. There are many reasons (font match - helvetica is non-free so most renderers use replacement fonts-, kerning, integer divisions in octave and then in the renderer ...) why the length of a string may not match between Octave and another renderer.

Our current approach is enough for short strings and powers of 10 in log plots, but I fear long strings will always be an issue until either gl2ps has improved text capabilities or Octave implements its own printing system using cairo/pango or Qt.

The only workaround I know of, if it can be called a workaround, is to use monospace font "courier"

Pantxo Diribarne <pantxo>
Project Member
Tue 19 Jul 2016 11:32:28 PM UTC, original submission:

This sample code produces a badly spaced superscript.

It appears that it may have something to do with very long lines. The following is also badly spaced.

Rik <rik5>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #41709:  character_position2.patch added by pantxo (18KiB - text/x-patch)
file #40032:  character_position.patch added by pantxo (18KiB - text/x-patch)
file #38701:  svg4.patch added by pantxo (10KiB - text/x-diff)
file #38702:  svg2other.m added by pantxo (4KiB - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by rik5 (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):

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Sep 2017 11:20:43 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 Sep 2017 01:29:36 PM UTCpantxoAttached File-=>Added character_position2.patch, #41709
    Mon 20 Mar 2017 11:55:39 AM UTCpantxoAttached File-=>Added character_position.patch, #40032
      StatusPostponed=>Patch Submitted
    Tue 11 Oct 2016 01:52:04 PM UTCpantxoAttached File-=>Added svg4.patch, #38701
      Attached File-=>Added svg2other.m, #38702
    Fri 22 Jul 2016 01:08:22 AM UTCrik5Priority5 - Normal=>3 - Low
      StatusConfirmed=>Postponed
    Thu 21 Jul 2016 01:02:59 PM UTCpantxoStatusNone=>Confirmed
    Tue 19 Jul 2016 11:32:55 PM UTCrik5Summarysuperscripts spaced incorrectly in title objects=>superscripts spaced incorrectly in text objects (OpenGL toolkit)

    Back to the top


    Powered by Savane 3.1-cleanup1