bugGNU Octave - Bugs: bug #52764, Non-ASCII characters are not...

 
 

bug #52764: Non-ASCII characters are not plotted correctly when printing to EPS and derived fromats

Submitted by:  Etienne Dechamps <edechamps>
Submitted on:  Sat 30 Dec 2017 11:17:50 AM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating 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)

Tue 20 Aug 2019 07:32:36 AM UTC, comment #12: 

@Markus: Thanks for testing. I pushed the patch here:
http://hg.savannah.gnu.org/hgweb/octave/rev/2c9795736894

Closing report as fixed.

Pantxo Diribarne <pantxo>
Project Member
Sun 21 Jul 2019 06:43:12 PM UTC, comment #11: 

With your patch, I am able to print to eps files using "-svgconvert". Also the changes to the documentation look good to me.

So please go ahead and push that patch on the default branch.

Markus Mützel <mmuetzel>
Project Member
Wed 12 Jun 2019 08:14:13 PM UTC, comment #10: 

I attached a patch that allows the use of "-svgconvert" together with the EPS format. This will allow non-ascii characters to be used but not transparency: any transparent object will cause the EPS file to contain a rasterized image of the figure. Any objection to pushing this on default?

This would eliminate the latest format for which non-ascii characters are forbidden (the others have been deprecated).

(file #47082)

Pantxo Diribarne <pantxo>
Project Member
Tue 06 Nov 2018 12:53:36 PM UTC, comment #9: 

Recent changes have narrowed down the number of situation where this bug can be observed. By default raster formats, like PNG in the original post, are fixed. As for vector formats, SVG has always been right and now it is also possible to have the PDF right, using the -svgconvert. Other vector format are derived from EPS and thus still don't support non-ascii characters.

Updating the title to reflect the remaining issue.

Pantxo Diribarne <pantxo>
Project Member
Wed 05 Sep 2018 08:55:09 PM UTC, comment #8: 

I modified patch that includes a warning with ID:

http://hg.savannah.gnu.org/hgweb/octave/rev/d19dfcc862d4

As for supporting multi-byte characters in the eps output, it is very hard work (need to patch the header "by hand" or modify gl2ps directly) including learning the postscript language, which is not very exciting.

The best I can think of for supporting multi-byte characters in eps is to convert from svg to pdf (see bug #52193) and then use ghostscript to convert the pdf to eps, this works very well if there is no transparent object in the scene.

Pantxo Diribarne <pantxo>
Project Member
Wed 05 Sep 2018 06:52:34 PM UTC, comment #7: 
Markus Mützel <mmuetzel>
Project Member
Wed 05 Sep 2018 06:36:01 PM UTC, comment #6: 

@Pantxo: With your patch applied, the svg still prints correctly (as expected).
When printing to png, I no longer see an error. But a warning:

warning: print: only ASCII characters are supported for EPS and derived formats.
warning: called from
    __opengl_print__ at line 158 column 7
    print at line 565 column 14

And the degree sign doesn't display correctly in the png.

So we are back to the state of the original report.

Since we can't get full Unicode support as long as we go through eps, the current situation is worse (no png at all) and your patch gives a meaningful warning, I'd say: Go ahead and push the change.

Before you do that, could you change the warning to warning_with_id?

Markus Mützel <mmuetzel>
Project Member
Wed 05 Sep 2018 08:09:58 AM UTC, comment #5: 

@Markus: can you check that the attached patch fixes the issue you raised in comment #3?

(file #44938)

Pantxo Diribarne <pantxo>
Project Member
Sat 30 Jun 2018 10:14:35 PM UTC, comment #4: 

There is a whole bunch of bug reports due to inadequacies of
current printing system (which is essentially using postscript as
an intermidiate format). The proposed alternative E.g.:  https://savannah.gnu.org/bugs/?52193  have it own limitations...

At this moment, is one needs a bitmap format with special symbols/non-ascii fonts I would suggest either create an svg or pdf (via pdflatex) and convert those to desired format using other available tools (inkscape or xetex work for me).

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Sat 30 Jun 2018 02:23:16 PM UTC, comment #3: 

This is still failing on a current development build. However, trying to print as a .png now gives the following error:

Error: /rangecheck in --xshow--
Operand stack:
   --nostringval--   (This is a degree: \302\260)   --nostringval--
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push  2015   1   3   %oparray_pop   2014   1   3   %oparray_pop   --nostringval--   1998   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--
Dictionary stack:
   --dict:991/1684(ro)(G)--   --dict:0/20(G)--   --dict:83/200(L)--   --dict:43/64(L)--
Current allocation mode is local
GPL Ghostscript 9.22: Unrecoverable error, exit code 1

This might (or might not) be related to the change for bug #53646:
http://hg.savannah.gnu.org/hgweb/octave/rev/def1b446ba64

The degree sign "°" seems to have been converted to "\302\260". I am not sure where that comes from or which tools are involved. Maybe someone who better knows the printing system could chime in.

Also changing Operating System to "Any" because the same happens on Windows, too.

Markus Mützel <mmuetzel>
Project Member
Wed 28 Mar 2018 07:30:21 PM UTC, comment #2: 

another example, with a workaround with gnuplot/cairo:
https://stackoverflow.com/a/26939014/3565696

ederag <ederag>
Sat 30 Dec 2017 01:08:27 PM UTC, comment #1: 

This is a known issue but I don't think it has already been reported.

The problem is not specific to png (only do svg and eventually latex based outputs work) so I removed png from the title.

Pantxo Diribarne <pantxo>
Project Member
Sat 30 Dec 2017 11:17:50 AM UTC, original submission:  

Debian Unstable, Octave 4.2.1

Steps to reproduce: (in UTF-8)

graphics_toolkit("fltk");
title("This is a degree: °");
print('utf8.svg', '-dsvg');
print('utf8.png', '-dpng');

  • The window output is correct. "°" is displayed as "°".
  • The SVG output is correct. "°" is displayed as "°".
  • The PNG output is incorrect. "°" is displayed as "’".

Other non-ASCII characters have similar issues.

Etienne Dechamps <edechamps>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #47082:  eps_svg.patch added by pantxo (9KiB - text/x-patch)
file #44938:  eps_multibyte.patch added by pantxo (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by ederag (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by edechamps (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.

     

     

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-08-20 pantxo StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
    2019-06-12 pantxo Attached File- => Added eps_svg.patch, #47082
        StatusConfirmed => Patch Submitted
    2018-11-06 pantxo SummaryNon-ASCII characters are not plotted correctly when printing => Non-ASCII characters are not plotted correctly when printing to EPS and derived fromats
    2018-09-05 pantxo Attached File- => Added eps_multibyte.patch, #44938
    2018-06-30 mmuetzel Item GroupIncorrect Result => Unexpected Error
        Release4.2.1 => dev
        Operating SystemGNU/Linux => Any
    2017-12-30 pantxo StatusNone => Confirmed
        SummaryNon-ASCII characters are not plotted correctly when printing to PNG => Non-ASCII characters are not plotted correctly when printing

    Back to the top


    Powered by Savane 3.5