Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #1483 > unrolled thread
| Started by | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| First post | 2013-07-19 10:50 +0200 |
| Last post | 2013-07-23 10:38 -0700 |
| Articles | 14 — 4 participants |
Back to article view | Back to comp.lang.postscript
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
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2013-07-19 10:50 +0200 |
| Subject | List with special character escapes |
| Message-ID | <87ppufkk6l.fsf@Aspire.decebal.nl> |
Some characters should not be entered directly, but as escape. For
example:
ï -> \357
© -> \251
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.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2013-07-19 13:24 +0100 |
| Message-ID | <MPG.2c53404b256f7d1f9898a9@usenet.plus.net> |
| In reply to | #1483 |
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). > 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. 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. 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: http://www.acumentraining.com/acumenjournal.html Ken
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2013-07-20 10:15 +0200 |
| Message-ID | <87hafplk9h.fsf@Aspire.decebal.nl> |
| In reply to | #1484 |
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
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2013-07-20 12:13 +0100 |
| Message-ID | <MPG.2c548135c7ac26dc9898aa@usenet.plus.net> |
| In reply to | #1486 |
In article <87hafplk9h.fsf@Aspire.decebal.nl>, Cecil@decebal.nl says... > > 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? Umm, 'standard' is difficult. They are defined in some of teh standard encodings, yes. > By the way, before I use a font, I transform it with the following > function: Ah, so you are using the ISOLatin1Encoding, that makes a difference. > I should add this to the function then. (I want it to work with > ?every? function.) Is there a ?logical? place to put it? The ISOLatin1Encoding doesn't contain a Euro glyph encoding (htough oddly it does appear to contain what looks like a cent). You cna find the ISOLatin1Encoding defined in appendix E of the PostScript Language Reference Manual. Of course, you can modify the Encoding array before you use it, and create an Encoding mapping to the /Euro glyph at any point which is convenient for you. Ken
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2013-07-20 16:29 +0200 |
| Message-ID | <87d2qdl2y0.fsf@Aspire.decebal.nl> |
| In reply to | #1487 |
Op zaterdag 20 jul 2013 13:13 CEST schreef ken@spamcop.net: >> I should add this to the function then. (I want it to work with >> ?every? function.) Is there a ?logical? place to put it? Dumb mistake: ‘every function’ should be ‘every font’. > The ISOLatin1Encoding doesn't contain a Euro glyph encoding (htough > oddly it does appear to contain what looks like a cent). You cna > find the ISOLatin1Encoding defined in appendix E of the PostScript > Language Reference Manual. > > Of course, you can modify the Encoding array before you use it, and > create an Encoding mapping to the /Euro glyph at any point which is > convenient for you. The most logical place seems to be \244. But how to do it? I understood you can make an Euro symbol by superimposing a ‘=’ over a ‘c’, but how am I going to do that. My googling did not give me anything useful until now. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-07-20 10:46 -0700 |
| Message-ID | <a5615f13-5da1-4e22-a1c2-b102f7ba893c@googlegroups.com> |
| In reply to | #1488 |
On Saturday, July 20, 2013 9:29:43 AM UTC-5, Cecil Westerhof wrote:
> Op zaterdag 20 jul 2013 13:13 CEST schreef ken@spamcop.net:
>
>
>
> >> I should add this to the function then. (I want it to work with
> >> ?every? function.) Is there a ?logical? place to put it?
>
>
> Dumb mistake: ‘every function’ should be ‘every font’.
>
>
>
>
> > The ISOLatin1Encoding doesn't contain a Euro glyph encoding (htough
> > oddly it does appear to contain what looks like a cent). You cna
> > find the ISOLatin1Encoding defined in appendix E of the PostScript
> > Language Reference Manual.
>
> > Of course, you can modify the Encoding array before you use it, and
> > create an Encoding mapping to the /Euro glyph at any point which is
> > convenient for you.
>
>
>
> The most logical place seems to be \244. But how to do it? I
> understood you can make an Euro symbol by superimposing a ‘=’ over a
> ‘c’, but how am I going to do that. My googling did not give me
> anything useful until now.
>
You'd do it right in the middle of your font-preparation
function.
/fontToLatin {
<< 1 index findfont {} forall >>
begin
/Encoding ISOLatin1Encoding 256 array copy def
Encoding 244 /Euro put
currentdict end
definefont pop
} def
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2013-07-20 21:39 +0200 |
| Message-ID | <878v11kola.fsf@Aspire.decebal.nl> |
| In reply to | #1489 |
Op zaterdag 20 jul 2013 19:46 CEST schreef luser:
>> The most logical place seems to be \244. But how to do it? I
>> understood you can make an Euro symbol by superimposing a ‘=’ over
>> a ‘c’, but how am I going to do that. My googling did not give me
>> anything useful until now.
>>
>
> You'd do it right in the middle of your font-preparation
> function.
>
> /fontToLatin {
> << 1 index findfont {} forall >>
> begin
> /Encoding ISOLatin1Encoding 256 array copy def
> Encoding 244 /Euro put
> currentdict end
> definefont pop
> } def
That is simple. I thought I had to draw the symbol myself. Sometimes
live is a lot easier as you think. :-D
It works when 244 is changed to 164. The 244 is octal and you need a
decimal value. ;-)
Thanks.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | luser- -droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2013-07-20 13:36 -0700 |
| Message-ID | <cf11c05e-ca28-425e-ada8-4a3a05ada331@googlegroups.com> |
| In reply to | #1490 |
On Saturday, July 20, 2013 2:39:45 PM UTC-5, Cecil Westerhof wrote:
> Op zaterdag 20 jul 2013 19:46 CEST schreef luser:
>
>
>
> >> The most logical place seems to be \244. But how to do it? I
> >> understood you can make an Euro symbol by superimposing a ‘=’ over
> >> a ‘c’, but how am I going to do that. My googling did not give me
> >> anything useful until now.
>
>
> > You'd do it right in the middle of your font-preparation
> > function.
>
> > /fontToLatin {
> > << 1 index findfont {} forall >>
> > begin
> > /Encoding ISOLatin1Encoding 256 array copy def
> > Encoding 244 /Euro put
> > currentdict end
> > definefont pop
> > } def
>
>
>
> That is simple. I thought I had to draw the symbol myself. Sometimes
> live is a lot easier as you think. :-D
>
>
> It works when 244 is changed to 164. The 244 is octal and you need a
> decimal value. ;-)
>
Don't forget you can input values in octal or any base
with the Radix-Number notation
10#164
8#244
2#10100100
16#A4
[toc] | [prev] | [next] | [standalone]
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Date | 2013-07-20 23:13 +0200 |
| Message-ID | <874nbpkk9a.fsf@Aspire.decebal.nl> |
| In reply to | #1491 |
Op zaterdag 20 jul 2013 22:36 CEST schreef luser: > Don't forget you can input values in octal or any base > with the Radix-Number notation > > 10#164 > 8#244 > 2#10100100 > 16#A4 Did not know that. Learning all the time. :-D -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
[toc] | [prev] | [next] | [standalone]
| From | Ross Presser <rpresser@gmail.com> |
|---|---|
| Date | 2013-07-22 14:30 -0700 |
| Message-ID | <b10306b3-ff1e-45d1-a95b-c88226f66cfd@googlegroups.com> |
| In reply to | #1487 |
On Saturday, July 20, 2013 7:13:43 AM UTC-4, ken wrote: > The ISOLatin1Encoding doesn't contain a Euro glyph encoding (htough > oddly it does appear to contain what looks like a cent). You cna find > the ISOLatin1Encoding defined in appendix E of the PostScript Language > Reference Manual. Look at the publish date of the PLRM, and then at Wikipedia for history of the Euro symbol, and perhaps it won't seem so odd that ISOLatin1Encoding lacks an encoding for the Euro.
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2013-07-23 07:48 +0100 |
| Message-ID | <MPG.2c58377be70715af9898ab@usenet.plus.net> |
| In reply to | #1497 |
In article <b10306b3-ff1e-45d1-a95b-c88226f66cfd@googlegroups.com>, rpresser@gmail.com says... > > On Saturday, July 20, 2013 7:13:43 AM UTC-4, ken wrote: > > > The ISOLatin1Encoding doesn't contain a Euro glyph encoding (htough > > oddly it does appear to contain what looks like a cent). You cna find > > the ISOLatin1Encoding defined in appendix E of the PostScript Language > > Reference Manual. > > Look at the publish date of the PLRM, and then at Wikipedia for history > of the Euro symbol, and perhaps it won't seem so odd that ISOLatin1Encoding > lacks an encoding for the Euro. Its not the absence of a Euro I find surprising, as the presence of a cent. (Euro cent, not US cent).
[toc] | [prev] | [next] | [standalone]
| From | Ross Presser <rpresser@gmail.com> |
|---|---|
| Date | 2013-07-23 07:08 -0700 |
| Message-ID | <270300c2-e126-4316-a894-4d0b82bc6f36@googlegroups.com> |
| In reply to | #1498 |
On Tuesday, July 23, 2013 2:48:00 AM UTC-4, ken wrote: > In article > <b10306b3-ff1e-45d1-a95b-c88226f66cfd@googlegroups.com>, > rpresser@gmail.com says... > > > On Saturday, July 20, 2013 7:13:43 AM UTC-4, ken wrote: > > > The ISOLatin1Encoding doesn't contain a Euro glyph encoding > > > (htough oddly it does appear to contain what looks like a > > > cent). You cna find the ISOLatin1Encoding defined in appendix > > > E of the PostScript Language Reference Manual. > > > > Look at the publish date of the PLRM, and then at Wikipedia for > > history of the Euro symbol, and perhaps it won't seem so odd > > that ISOLatin1Encoding lacks an encoding for the Euro. > > Its not the absence of a Euro I find surprising, as the presence > of a cent. (Euro cent, not US cent). What symbol is that? If you mean ¢ (162 decimal in the ISOLatin1Encoding) then that *IS* the US cent symbol. If you mean something else, please say what. The ISOLatin1Encoding list here http://www.kostis.net/charsets/adobeiso.htm does not have anything else I can recognize as being a cent symbol, and Googling for "Euro cent symbol" has turned up nothing at all. Please help a poor dumb American :)
[toc] | [prev] | [next] | [standalone]
| From | ken <ken@spamcop.net> |
|---|---|
| Date | 2013-07-23 16:16 +0100 |
| Message-ID | <MPG.2c58aeb6a6979c839898ac@usenet.plus.net> |
| In reply to | #1500 |
In article <270300c2-e126-4316-a894-4d0b82bc6f36@googlegroups.com>, rpresser@gmail.com says... > > Its not the absence of a Euro I find surprising, as the presence > > of a cent. (Euro cent, not US cent). > > What symbol is that? If you mean ¢ (162 decimal in the > ISOLatin1Encoding) then that *IS* the US cent symbol. Hmm, I thought that was the Euro cent symbol, I thought the US one was just a small c. Oh well, I am not an American, therefore not expected to recognise the US cent symbol :-) FWIW the WinAnsiEncoding and PDFDocEncoding both include a Euro symbol.
[toc] | [prev] | [next] | [standalone]
| From | Ross Presser <rpresser@gmail.com> |
|---|---|
| Date | 2013-07-23 10:38 -0700 |
| Message-ID | <39f64c8a-7667-4e7a-b32c-18041669b85d@googlegroups.com> |
| In reply to | #1501 |
On Tuesday, July 23, 2013 11:16:42 AM UTC-4, ken wrote: > Hmm, I thought that was the Euro cent symbol, I thought the US one was > just a small c. Oh well, I am not an American, therefore not expected to > recognise the US cent symbol :-) Goes back to at least 1877 in the USA. http://books.google.com/books?id=LORHAAAAIAAJ&pg=PA23 Of course it may be that it was imported from some other currency. The meaning of "cent" comes from Latin, of course.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web