Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #1438

Re: Using special characters like ©

From Cecil Westerhof <Cecil@decebal.nl>
Newsgroups comp.lang.postscript
Subject Re: Using special characters like ©
Organization Decebal Computing
References <87a9lpdvnm.fsf@Aspire.decebal.nl> <1adf2700-2a2a-41ad-9878-bb2e733e9cb1@googlegroups.com>
Date 2013-07-14 20:34 +0200
Message-ID <871u71dm8i.fsf@Aspire.decebal.nl> (permalink)

Show all headers | View raw


Op zondag 14 jul 2013 18:50 CEST schreef luser:

> On Sunday, July 14, 2013 10:10:53 AM UTC-5, Cecil Westerhof wrote:
>> With the following I can use ©,€, ¢, etc in postscript:
>>
>> /Bookman
>> << /Bookman findfont {} forall >>
>> begin
>> /Encoding ISOLatin1Encoding 256 array copy def currentdict
>> end
>> definefont pop
>>
>>
>> I have two questions about this.
>>
>>
>>
>> - Is it possible to write a function that receives a font that has
>> to be converted?
>>
>
> Certainly, just pull the name out.
>
> /Bookman
>
>
> << 1 index findfont {} forall >>
> begin
> /Encoding ISOLatin1Encoding 256 array copy def currentdict
> end
> definefont pop
>
> ===>
>
>
> /proc {
> << 1 index findfont {} forall >>
> begin
> /Encoding ISOLatin1Encoding 256 array copy def currentdict
> end
> definefont pop
> } def
>
> /Bookman proc

Works like a charm. Thanks, now it is much easier to switch fonts. I
called the function fontToLatin and use:
    /URWChanceryL dup
    fontToLatin
    /usedFont exch findfont def

When I want to use another font I only have to change it in one
location.


>> - I need to use \251, because if I use © in the generated PDF I
>> get: ©. Why?
>
> Looks like you're getting a 2-byte Unicode character.
> Postscript really doesn't work with Unicode.

At the moment I do not use those special characters a lot. So for the
moment I can live with. If I am going to use them more I should write
a preprocessor.


-- 
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


Thread

Using special characters like © Cecil Westerhof <Cecil@decebal.nl> - 2013-07-14 17:10 +0200
  Re: Using special characters like © luser- -droog <mijoryx@yahoo.com> - 2013-07-14 09:50 -0700
    Re: Using special characters like © Helge Blischke <h.blischke@acm.org> - 2013-07-14 20:41 +0200
    Re: Using special characters like © Cecil Westerhof <Cecil@decebal.nl> - 2013-07-14 20:34 +0200
    Re: Using special characters like © Cecil Westerhof <Cecil@decebal.nl> - 2013-07-15 14:10 +0200

csiph-web