[GRASS-dev] [bug #5195] (grass) ps.map sets encoding to iso-8859-1

this bug's URL: http://intevation.de/rt/webrt?serial_num=5195
-------------------------------------------------------------------------

Subject: ps.map sets encoding to iso-8859-1

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060921

On line 92 of ps/ps.map/prolog.ps the encoding is set to ISOLatin1Encoding.

If I understand correctly (and some testing confirms this) this means that the instructions file for ps.map has to be encoded in iso-8859-1 (or similar) to work, i.e. to be able to print accented characters. If you are in a UTF-8 environment, ps.map creates a ps file which doesn't show correct accented characters be it in iso or in utf.

Is there any reason why ps.map hardcodes the encoding ? Is it possible to automatically use the users encoding ?

Moritz

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=5195
-------------------------------------------------------------------------

Subject: ps.map sets encoding to iso-8859-1

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060921

On line 92 of ps/ps.map/prolog.ps the encoding is set to ISOLatin1Encoding.

If I understand correctly (and some testing confirms this) this
means that the instructions file for ps.map has to be encoded in
iso-8859-1 (or similar) to work, i.e. to be able to print accented
characters. If you are in a UTF-8 environment, ps.map creates a ps
file which doesn't show correct accented characters be it in iso or
in utf.

Is there any reason why ps.map hardcodes the encoding ? Is it
possible to automatically use the users encoding ?

The reason why we force the font's encoding to ISOLatin1Encoding is
that the default encoding for most Latin fonts is StandardEncoding,
which (contrary to its name) is a completely non-standard encoding
which (AFAICT) is not used by anything except PostScript.

The value of the Encoding property is an array of 256 glyph names, so
you can use any unibyte encoding (e.g. ISO-646-*, ISO-8859-*,
windows-12?? etc).

If you want to support more complex encodings, you need to use
CID-keyed fonts. Apart from being rather complex, CID-keyed fonts may
not be supported by PostScript printers sold outside of South-East
Asia.

In short, allowing the encoding to be changed to other unibyte
encodings is simple enough. Anything else will require a willing
volunteer (i.e. not me), and will need to be implemented in such a way
that users don't end up accidentally producing documents which show up
fine in (recent versions of) Ghostscript but which will be rejected by
every PostScript printer on this half of the planet.

--
Glynn Clements <glynn@gclements.plus.com>

Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=5195
> -------------------------------------------------------------------
>
> Subject: ps.map sets encoding to iso-8859-1

..

> On line 92 of ps/ps.map/prolog.ps the encoding is set to
> ISOLatin1Encoding.
>
> If I understand correctly (and some testing confirms this) this
> means that the instructions file for ps.map has to be encoded in
> iso-8859-1 (or similar) to work, i.e. to be able to print accented
> characters. If you are in a UTF-8 environment, ps.map creates a ps
> file which doesn't show correct accented characters be it in iso or
> in utf.
>
> Is there any reason why ps.map hardcodes the encoding ? Is it
> possible to automatically use the users encoding ?

FWIW, if all you want is accents, ps.map should be able to pass through
the standard ascii extended chars. e.g. I use the (c), ^2, degree
symbols a lot. gnome-terminal doesn't like them, but they are fine
passed from an input file. Alternately direct insertion using rxvt+vi on
the output PostScript file can get the job done. If you try this & have
many to do, I suggest leaving some breadcrumbs for the search&replace to
find.

Hamish