Use the "glyphshow operator" to display unicode char in EPS
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://
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_
Changed in inkscape: | |
status: | Incomplete → Confirmed |
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.