Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 31 Oct 2012 11:09:27 -0500 From: John Deubert Organization: Acumen Training Newsgroups: comp.lang.postscript Date: Wed, 31 Oct 2012 09:09:27 -0700 Message-ID: <2012103109092788173-john@acumentrainingcom> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: glyphshow User-Agent: Unison/2.1.9 Lines: 76 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-229Kcrbo5W6SRJNppWtu6hilynCKx7BpMnpOX0pQsxl4UQQtX8p+tORE9CONZcGdwqpHXRrH9cLJDR/!rM6thQ87LxXiA3MMNE3TbQOo5nuWbiav9ivfFvG7yq7xo3Qf+X7oq5CGa/VnuFPK2wtN0Bep X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3310 Xref: csiph.com comp.lang.postscript:1022 On 2012-10-31 13:55:33 +0000, wg said: > Greetings, > > on linux I'm using enscript for document processing and manually insert > raw PostScript code to get the Eurosymbol printed. > I do this by replacing all \244 with ^@ps{/Euro glyphshow} > This works fine when using monospace fonts. > However, using varaible-width fonts, the Eurosign is placed in the > wrong horizontal position. > > My questions are: > 1) how do I set the current x position with ps so that I can use the > moveto/rmoveto command to place the Eurosign correctly? > 2) how do I increment to current x position, so that the following text > does not overwrite the Eurosign. > > > Thanks for hints > Wolf You might consider a different approach to the problem; you could modify the current font so that \244 actually prints the Euro sign. Here's a snippet that defines an "AddEuro" procedure that adds the Euro character to a font dictionary. Note that you need to provide a name for the new, euro-fied font. % ============= cut here ============== /Helvetica findfont 30 scalefont setfont /AddEuro % /newFName <> => <> { dup length dict copy % /newFName <> begin /Encoding Encoding % /newFName /Encoding [Enc] dup length array copy % /newFName /Encoding [EncCopy] dup 8#244 /Euro put % /newFName /Encoding [EncCopy] def % /newFName currentdict definefont } bind def /Helvetica findfont /HelvEuro exch AddEuro 30 scalefont setfont 72 600 moveto (It costs \244234.99) show showpage % ============= cut here ============== You could call the AddEuro procedure before each setfont and then just leave the \244 in place in the strings. If you want to see how this does what it does, I refer you to the November and December 2001 issues (#11 & 12) of the Acumen Journal, which explains it all in detail. The journal is free for the downloading at http://www.acumentraining.com/acumenjournal.html. Hope this helps. - John -- ======== John Deubert Acumen Training PostScript & PDF Engineering Classes & Consulting www.acumentraining.com Learn PostScript programming techniques Read the free Acumen Journal acumentraining.com/acumenjournal.html