bugGNU Octave - Bugs: bug #62884, "-svgconvert" print...


bug #62884: "-svgconvert" print option causes incorrectly colored Latex output

Submitter:  Fabio <efferre79>
Submitted:  Wed 10 Aug 2022 12:01:47 PM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 7.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Tue 23 Aug 2022 05:03:04 PM UTC, comment #7: 

>> PS. I don't understand why I stopped receiving email notifications about comments to this issue (in particular the last two comments).

The Savannah bug tracker software is pretty old, and only receives occasional maintenance and no feature additions.  Sometimes it doesn't behave very well.

Rik <rik5>
Group administrator
Tue 23 Aug 2022 04:53:40 PM UTC, comment #6: 

Thanks for the quick fix! I have compiled octave with the patch and confirm it works.

PS. I don't understand why I stopped receiving email notifications about comments to this issue (in particular the last two comments).

Fabio <efferre79>
Tue 16 Aug 2022 04:08:02 AM UTC, comment #5: 

I tested the changeset and it looks good.  I checked in the new code here http://hg.savannah.gnu.org/hgweb/octave/rev/bb9d776eafac.

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Sun 14 Aug 2022 04:31:13 PM UTC, comment #4: 

I found the issue and the fix is actually very simple so I think it would be safe to push it to stable. See attached patch.

(file #53568)

Pantxo Diribarne <pantxo>
Group Member
Fri 12 Aug 2022 03:38:00 PM UTC, comment #3: 

The documentation for the "-svgconvert" option to print says

          When using the '-painters' renderer, this enables a different
          backend toolchain with enhanced characteristics:

          Font handling:
               For interpreters "none" and "tex", the actual font is
               embedded in the output file which allows for printing
               arbitrary characters and fonts in all vector formats.

               Strings using the "latex" interpreter, are rendered using
               path objects.  This looks good but note that textual info
               (font, characters...) are lost.

So, there are changes to strings which use the "latex" interpreter (conversion to path objects) which might be influencing things.

I think the fastest workaround right now is to print to svg and then use another program such as Inkscape or your own test.py to convert svg to pdf.

I added @Pantxo to the CC list for this report since he did the most to write octave-svgconvert and maybe knows how to fix this quickly.

As a work

Rik <rik5>
Group administrator
Thu 11 Aug 2022 08:40:25 AM UTC, comment #2: 

Rik, thanks for the prompt support. I am using Qt 5.15.5.

I am using -svgconvert option because the qt toolkit, being opengl-based, generates postscript which is limiting fonts. But I need at output a pdf with Times New Roman.

I have written a simple python script (test.py) to convert the tst_latex.svg file to pdf by using Qt and I don't see the problem. I am not familiar with Qt so maybe something is missing in replicating exactly the code implemented in octave-svgconvert.

I am able to compile octave for testing.

(file #53559)

Fabio <efferre79>
Wed 10 Aug 2022 09:29:23 PM UTC, comment #1: 

Confirmed.  This is also an issue with the development version of Octave.

The trouble is with the "-svgconvert" option.  One can verify this by using "print -dsvg ...." and checking the resulting file which renders correctly.

I have attached a minimal case "tst_latex.m".

If I run

octave-svgconvert tst_latex.svg svg 300 Arial 1 tst.svg

then the resulting svg file is fine.  But, if the output is to PDF

octave-svgconvert tst_latex.svg pdf 300 Arial 1 tst.pdf

then the file is incorrect.  Octave is using Qt libraries and it may be a bug in the rendering libraries.

Rik <rik5>
Group administrator
Wed 10 Aug 2022 12:01:47 PM UTC, original submission:  

octave graphics toolkit is the default qt.

I am using latex interpreter to write the axis label of a plot and I am changing the label color. When exporting the plot to png there are no problems, when exporting to pdf the latex part of the label has the wrong color. Here is attached the results and the demo script.

Fabio <efferre79>


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

Attach Files:

Attached Files
file #53568:  bug62884.patch added by pantxo (2KiB - text/x-patch)
file #53559:  test.py added by efferre79 (439B - text/x-python)
file #53556:  tst_latex.m added by rik5 (411B - text/x-matlab)
file #53553:  test.m added by efferre79 (438B - text/x-objcsrc)
file #53554:  test.pdf added by efferre79 (19KiB - application/pdf)
file #53555:  test.png added by efferre79 (19KiB - 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 (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by efferre79 (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 13 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-08-16 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2022-08-14 pantxo Attached File- Added bug62884.patch, #53568
        StatusConfirmed Patch Submitted
    2022-08-11 efferre79 Attached File- Added test.py, #53559
    2022-08-10 rik5 Attached File- Added tst_latex.m, #53556
    2022-08-10 rik5 Item GroupNone Incorrect Result
        StatusNone Confirmed
        Summarypartial coloring of axis label with pdf output "-svgconvert" print option causes incorrectly colored Latex output
        Carbon-Copy- Added pantxo
    2022-08-10 efferre79 Attached File- Added test.m, #53553
        Attached File- Added test.pdf, #53554
        Attached File- Added test.png, #53555

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code