Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #950
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "Jeffrey H. Coffield" <jeffrey@digitalsynergyinc.com> |
| Newsgroups | comp.lang.postscript |
| Subject | Strange (to me) stringwidth behavoir |
| Date | Sat, 08 Sep 2012 08:39:32 -0700 |
| Organization | A noiseless patient Spider |
| Lines | 40 |
| Message-ID | <k2form$ump$1@dont-email.me> (permalink) |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Sat, 8 Sep 2012 15:39:34 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="f83130f6cce1b1f684aefefec4705a4d"; logging-data="31449"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xF2MiTSsY1VGyjtKCMNsC6q5DRpmi8Ic=" |
| User-Agent | Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120824 Thunderbird/15.0 |
| Cancel-Lock | sha1:mKnxDMK6Qic2IjXM++G1JTYm4tY= |
| Xref | csiph.com comp.lang.postscript:950 |
Show key headers only | View raw
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
Back to comp.lang.postscript | Previous | Next — Next in thread | Find similar | Unroll 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