Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1486
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Newsgroups | comp.lang.postscript |
| Subject | Re: List with special character escapes |
| Organization | Decebal Computing |
| References | <87ppufkk6l.fsf@Aspire.decebal.nl> <MPG.2c53404b256f7d1f9898a9@usenet.plus.net> |
| Date | 2013-07-20 10:15 +0200 |
| Message-ID | <87hafplk9h.fsf@Aspire.decebal.nl> (permalink) |
Op vrijdag 19 jul 2013 14:24 CEST schreef ken@spamcop.net:
> In article <87ppufkk6l.fsf@Aspire.decebal.nl>, Cecil@decebal.nl
> says...
>
>> Some characters should not be entered directly, but as escape. For
>> example:
>> ï -> \357
>> © -> \251
>
> Its not clear what you mean here, there are very few byte values
> which havce to be entered as 'escapes' (octal values).
Because my editor puts those characters as two byte codes into my
files and postscript can not work with those I have to translate them
in my prepocessor. For exeample I have:
(© Cecil Westerhof) show
Which will not be rendered correctly.
In my preprpcessor I have:
echo ${INPUT_LINE} | awk '{
gsub(/ï/, "\357");
gsub(/€/, "\333");
gsub(/©/, "\251");
sub(/ *$/, "");
sub(/^ */, "");
if ($0 != "") {
print;
}
}' >>${EXP_FILE}
This works perfectly for ï and ©, but not for €.
>> Is there a list of those codes? For example: I need to use € in my
>> postscript code, but can not find the escape code for it. I found
>> several ones, but neither was correct.
>
> OK so it looks like you're talking about rendering text. The
> character code you use depends on the Encoding applied to the font.
> I can happily code fonts where Encoding position 0x41 had the name
> /A. Assuming that teh font I'm using has a Charstring entry called
> /A then when I put 0x41 (or A) in the string argument to show then
> I'll get the appropraite glyph on the output.
If I understand correctly: © and ï are standard, but € is not?
By the way, before I use a font, I transform it with the following
function:
/fontToLatin {
<< 1 index findfont {} forall >>
begin
/Encoding ISOLatin1Encoding 256 array copy def currentdict
end
definefont pop
} def
> However I could equally well have an Encoding where position 1 is
> /A, in that case the string argument to show would have to contain
> 0x01 (\001) in order to render the same CharString.
>
> So the answer to your question is that you have to use the character
> code whose Encoding position contains the /Euro. Or of course, you
> could re-encode the font so that the Euro glyph is at a position you
> like in the Encoding vector.
I should add this to the function then. (I want it to work with
‘every’ function.) Is there a ‘logical’ place to put it?
> Encoding vectors have been discussed rather a lot here, a search
> through a UseNet archive should turn up several threads. Or you can
> refer to John Deubert's excellent series of articles, 'the Acumen
> Journal'. In particular the November and December 2001 issues. You
> can find them here:
I'll look into it.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
List with special character escapes Cecil Westerhof <Cecil@decebal.nl> - 2013-07-19 10:50 +0200
Re: List with special character escapes ken <ken@spamcop.net> - 2013-07-19 13:24 +0100
Re: List with special character escapes Cecil Westerhof <Cecil@decebal.nl> - 2013-07-20 10:15 +0200
Re: List with special character escapes ken <ken@spamcop.net> - 2013-07-20 12:13 +0100
Re: List with special character escapes Cecil Westerhof <Cecil@decebal.nl> - 2013-07-20 16:29 +0200
Re: List with special character escapes luser- -droog <mijoryx@yahoo.com> - 2013-07-20 10:46 -0700
Re: List with special character escapes Cecil Westerhof <Cecil@decebal.nl> - 2013-07-20 21:39 +0200
Re: List with special character escapes luser- -droog <mijoryx@yahoo.com> - 2013-07-20 13:36 -0700
Re: List with special character escapes Cecil Westerhof <Cecil@decebal.nl> - 2013-07-20 23:13 +0200
Re: List with special character escapes Ross Presser <rpresser@gmail.com> - 2013-07-22 14:30 -0700
Re: List with special character escapes ken <ken@spamcop.net> - 2013-07-23 07:48 +0100
Re: List with special character escapes Ross Presser <rpresser@gmail.com> - 2013-07-23 07:08 -0700
Re: List with special character escapes ken <ken@spamcop.net> - 2013-07-23 16:16 +0100
Re: List with special character escapes Ross Presser <rpresser@gmail.com> - 2013-07-23 10:38 -0700
csiph-web