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


Groups > comp.lang.postscript > #951

Re: Strange (to me) stringwidth behavoir

From Helge Blischke <h.blischke@acm.org>
Newsgroups comp.lang.postscript
Subject Re: Strange (to me) stringwidth behavoir
Followup-To comp.lang.postscript
Date 2012-09-08 18:51 +0200
Message-ID <ab1bcoFlpqoU1@mid.individual.net> (permalink)
References <k2form$ump$1@dont-email.me>

Followups directed to: comp.lang.postscript

Show all headers | View raw


Jeffrey H. Coffield wrote:

> I recently saw a problem in using stringwidth to determine when to break
> a line in a paragraph. The following code demonstrates the problem:
> -----------------------------------------------
> %!PS
> 
> /Helvetica 24 selectfont
> 
> 100 100 moveto
> (somedata) stringwidth pop 10 string cvs show
> 
> showpage
> -----------------------------------------------
> 
> The problem is that the number shown changes with the output device.
> 
> Using GPL Ghostscript 9.00 on Suse Linux 11.4:
> 
> Running "gs x.ps" shows 105.367.
> 
> Using emacs postscript mode shows 105.379.
> 
> Using "gs -sOutputFile=x.jpg -sDEVICE=jpeg x.ps" shows 105.379
> 
> Using "gs -sOutputFile=x.pdf -sDEVICE=pdfwrite x.ps" shows 105.382
> 
> When I send it to a printer I get yet another number.
> 
> This happens with any font even ones that are loaded from a .gsf file
> that was also loaded on the printer. I also tested this on OpenVMS
> Itanium 8.4 with AFPL Ghostscript 8.51 and I get different numbers.
> 
> Why would the stringwidth vary depending on the output device?
> 
> I am aware the PLRM recommends that the font metrics from the AFM file
> be used instead of using PostScript, but that will be a big change and I
> don't have the .AFM file for all the fonts I need to use.
> 
> Jeff Coffield
> www.digitalsynergyinc.com

I suspect the reason is that, on different platforms, there are different 
variants of Helvetica implemented.

Helge

Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Strange (to me) stringwidth behavoir "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> - 2012-09-08 08:39 -0700
  Re: Strange (to me) stringwidth behavoir Helge Blischke <h.blischke@acm.org> - 2012-09-08 18:51 +0200
  Re: Strange (to me) stringwidth behavoir SaGS <sags5495@gmail.com> - 2012-09-08 10:22 -0700
    Re: Strange (to me) stringwidth behavoir deedubman@gmail.com - 2012-09-09 12:54 -0700
  Re: Strange (to me) stringwidth behavoir tlvp <mPiOsUcB.EtLlLvEp@att.net> - 2012-09-08 21:56 -0400

csiph-web