Use the "glyphshow operator" to display unicode char in EPS

Bug #171785 reported by Pdealmeida
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

Hello,

I have found how to handle special characters (unicode) when exporting SVG
to EPS.
Today, Inkscape only converts special characters to its octal value, but
this is not valid Postscript because the glyph is not displayed.

Example in a EPS file created by Inkscape:
"....
(\22672 It is \274) show
grestore
..."

There are 2 ways to display special characters in PostScript:
- Re-encoding the vectors of local fonts used in the files (not recommended
and very heavy to do)
- Using the “glyphshow” operator

The 2nd solution should be easier to implement.
To do that, you need to use a character map (can be found here
http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt)

Then, instead of converting the hexadecimal value of the character, you can
just replace it by its glyph name and call the glyphshow operator.

Example with glyphshow operator:
"%% This part is added at the begining of the file:
/bdef {bind def} bind def
/gs {{glyphshow} forall} bdef
...
...
[/triagrt] gs
(It is) show
[/onequarter] gs
..."

/triagrt stands for character \22672
/onequater stands for character \274

Then, the EPS becomes valid and special characters correctly displayed !

Please find attached a perl script I wrote which replaces octal values of
unicode characters in EPS files. I a not an expert at all, but it works
fine. Please also find attached an EPS sample (one after Inkscape
conversion, and another one after the perl script is executed).

It would be very useful for me to have such feature integrated in the
Inkscape product. I hope it will be feasible... Thanks a lot in advance and
don't hesistate to ask for clarification !

PS: to use the perl script: perl map.pl -d
"path_of_the_directory_where_EPS_file_is_stored"

Tags: exporting
Revision history for this message
Pdealmeida (pdealmeida) wrote :
Revision history for this message
Bryce Harrington (bryce) wrote :

Please test against a recent version of Inkscape 0.46-pre1 or newer. EPS export has been redone, so this issue might not exist any longer.

Changed in inkscape:
status: New → Incomplete
Revision history for this message
Austin Lund (austin-lund) wrote :

I have a file (which if from my PhD thesis) exported with 0.46 and it still does this.

However my situation is worse. It seems that the characters I use aren't in the standard list. Perhaps there are other equivalents that are, I'm not sure.

I'll attach the SVG I generated in inkscape and the EPS I get from 0.46 for reference.

Revision history for this message
Austin Lund (austin-lund) wrote :
Revision history for this message
Austin Lund (austin-lund) wrote :

Is this bug related to bug #166626?

P Linnell (mrdocs)
Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
Buliabyak-users (buliabyak-users) wrote :

we now use cairo ps/pdf surface for export to these formats, so it's cairo that generates eps for us; in any event, special characters are now correctly exported to eps

Changed in inkscape:
status: Confirmed → Fix Released
Revision history for this message
glenstewart (glen-stewart) wrote :

Is this possibly associated to this bug report ? https://bugs.launchpad.net/inkscape/+bug/277603

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.