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


Groups > comp.lang.postscript > #1433 > unrolled thread

Using special characters like ©

Started byCecil Westerhof <Cecil@decebal.nl>
First post2013-07-14 17:10 +0200
Last post2013-07-15 14:10 +0200
Articles 5 — 3 participants

Back to article view | Back to comp.lang.postscript


Contents

  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

#1433 — Using special characters like ©

FromCecil Westerhof <Cecil@decebal.nl>
Date2013-07-14 17:10 +0200
SubjectUsing special characters like ©
Message-ID<87a9lpdvnm.fsf@Aspire.decebal.nl>
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?
- I need to use \251, because if I use © in the generated PDF I get:
  ©. Why?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#1434

Fromluser- -droog <mijoryx@yahoo.com>
Date2013-07-14 09:50 -0700
Message-ID<1adf2700-2a2a-41ad-9878-bb2e733e9cb1@googlegroups.com>
In reply to#1433
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


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

[toc] | [prev] | [next] | [standalone]


#1437

FromHelge Blischke <h.blischke@acm.org>
Date2013-07-14 20:41 +0200
Message-ID<b4g9nbF56ohU5@mid.individual.net>
In reply to#1434

[Multipart message — attachments visible in raw view] — view raw

luser- -droog wrote:

>[...]
> 
> Looks like you're getting a 2-byte Unicode character.
> Postscript really doesn't work with Unicode.
Though looking a liitle bit queer, using the Adobe glyph list
and the glyphshoe operator you *can* render Unicode strings in PostScript, 
provided the font(s) used provide the respective glyphs *and* sort of well 
formed glyph names.
See the core procedure in the attachment.

Helge



[toc] | [prev] | [next] | [standalone]


#1438

FromCecil Westerhof <Cecil@decebal.nl>
Date2013-07-14 20:34 +0200
Message-ID<871u71dm8i.fsf@Aspire.decebal.nl>
In reply to#1434
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

[toc] | [prev] | [next] | [standalone]


#1441

FromCecil Westerhof <Cecil@decebal.nl>
Date2013-07-15 14:10 +0200
Message-ID<87sizgrpl4.fsf@Aspire.decebal.nl>
In reply to#1434
Op zondag 14 jul 2013 18:50 CEST schreef luser:

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

Solved it by writing a preprocessor:
    echo ${line} | awk '{
      gsub(/©/, "\251");
      print}' >>${EXP_FILE}

Missing a lot of flutes and whistles, but those are not necessary at
the moment.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web