<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Why Mac programmers should learn PostScript</title>
	<atom:link href="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript/feed" rel="self" type="application/rss+xml" />
	<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript</link>
	<description>The personal weblog of Peter Hosey.</description>
	<pubDate>Tue, 07 Oct 2008 05:23:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-115428</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Thu, 23 Aug 2007 18:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-115428</guid>
		<description>&lt;blockquote&gt;Since Quartz is based on Postscript through PDF, is it possible (or feasible) to render the postscript directly, without converting it to PDF?&lt;/blockquote&gt;

PDF's vector-graphics language is derived from PostScript, but isn't PostScript exactly; in particular, flow-control is missing, and many command names are different (abbreviated).

&lt;blockquote&gt;It would be nice to have a subclass of NSView which directly renders the PS.&lt;/blockquote&gt;

Indeed it would, but that's possible now. Hint: Start with NSScanner. ☺

&lt;blockquote&gt;Another strange thing I don't understand; why does ps2pdf produce much better looking PDFs than Preview?&lt;/blockquote&gt;

I haven't observed that. Both go through the same API, so they should always produce exactly the same results. (Easy way to check would be saving the PDF from Preview, then comparing the PDFs to see if anything is different, and if so, what.)</description>
		<content:encoded><![CDATA[<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>Since Quartz is based on Postscript through PDF, is it possible (or feasible) to render the postscript directly, without converting it to PDF?</p>
</blockquote>
<p>PDF's vector-graphics language is derived from PostScript, but isn't PostScript exactly; in particular, flow-control is missing, and many command names are different (abbreviated).</p>
<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>It would be nice to have a subclass of NSView which directly renders the PS.</p>
</blockquote>
<p>Indeed it would, but that's possible now. Hint: Start with NSScanner. ☺</p>
<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>Another strange thing I don't understand; why does ps2pdf produce much better looking PDFs than Preview?</p>
</blockquote>
<p>I haven't observed that. Both go through the same API, so they should always produce exactly the same results. (Easy way to check would be saving the PDF from Preview, then comparing the PDFs to see if anything is different, and if so, what.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-115426</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Thu, 23 Aug 2007 18:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-115426</guid>
		<description>Since Quartz is based on Postscript through PDF, is it possible (or feasible) to render the postscript directly, without converting it to PDF?  It would be nice to have a subclass of NSView which directly renders the PS. 

Another strange thing I don't understand; why does ps2pdf produce much better looking PDFs than Preview?</description>
		<content:encoded><![CDATA[<p>Since Quartz is based on Postscript through PDF, is it possible (or feasible) to render the postscript directly, without converting it to PDF?  It would be nice to have a subclass of NSView which directly renders the PS. </p>
<p>Another strange thing I don't understand; why does ps2pdf produce much better looking PDFs than Preview?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-101486</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Mon, 02 Jul 2007 08:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-101486</guid>
		<description>It's still not finished. ☺

I will finish it; please be patient.</description>
		<content:encoded><![CDATA[<p>It's still not finished. ☺</p>
<p>I will finish it; please be patient.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Goodwin</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-101480</link>
		<dc:creator>Samuel Goodwin</dc:creator>
		<pubDate>Mon, 02 Jul 2007 07:30:29 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-101480</guid>
		<description>So where's the tutorial you said you'd write? I'm interested :)</description>
		<content:encoded><![CDATA[<p>So where's the tutorial you said you'd write? I'm interested :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-49598</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Sun, 27 May 2007 01:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-49598</guid>
		<description>David LaVallee: Yup, but it's not interactive, which is really handy when you're debugging a complex PS program.

As it happens, I'm working on the tutorial today. I doubt I'll have it out today, but I am making progress.</description>
		<content:encoded><![CDATA[<p>David LaVallee: Yup, but it's not interactive, which is really handy when you're debugging a complex PS program.</p>
<p>As it happens, I'm working on the tutorial today. I doubt I'll have it out today, but I am making progress.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David LaVallee</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-49592</link>
		<dc:creator>David LaVallee</dc:creator>
		<pubDate>Sun, 27 May 2007 01:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-49592</guid>
		<description>OSX preview.app will render PostScript files, such as the following:

%!PS-Adobe
/Times-Roman findfont 80 scalefont setfont
10 600 moveto (Hello World) show

Adobe Illustrator CS2, CS3 are also able to render postscript. I'm planning on using this to do algorithmic drawing with Postscript, and then use the output directly in Illustrator and Flash.</description>
		<content:encoded><![CDATA[<p>OSX preview.app will render PostScript files, such as the following:</p>
<p>%!PS-Adobe<br />
/Times-Roman findfont 80 scalefont setfont<br />
10 600 moveto (Hello World) show</p>
<p>Adobe Illustrator CS2, CS3 are also able to render postscript. I'm planning on using this to do algorithmic drawing with Postscript, and then use the output directly in Illustrator and Flash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19916</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Sun, 08 Apr 2007 06:00:38 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19916</guid>
		<description>&lt;blockquote&gt;&lt;p&gt;I think reason #8 should be "It's fun". Maybe it's just me but I thought programming in PostScript to be pretty nifty. Something about playing with the stack. In a certain way, PostScript is like Logo for "grown-up" programmers.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Totally. Consider it added.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;Is there an interactive PS interpreter available?&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Yup: &lt;a href="http://www.cs.wisc.edu/~ghost/" rel="nofollow"&gt;GhostScript&lt;/a&gt;. You'll need X11 installed and running to use it. It provides a live interpreter, as well as its own implementation of pstopdf and a few other PostScript-related utilities.&lt;/p&gt;

&lt;p&gt;I'll be sure to mention that in the tutorial post.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>I think reason #8 should be "It's fun". Maybe it's just me but I thought programming in PostScript to be pretty nifty. Something about playing with the stack. In a certain way, PostScript is like Logo for "grown-up" programmers.</p>
</blockquote>
<p>Totally. Consider it added.</p>
<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>Is there an interactive PS interpreter available?</p>
</blockquote>
<p>Yup: <a href="http://www.cs.wisc.edu/~ghost/" rel="nofollow">GhostScript</a>. You'll need X11 installed and running to use it. It provides a live interpreter, as well as its own implementation of pstopdf and a few other PostScript-related utilities.</p>
<p>I'll be sure to mention that in the tutorial post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Kim</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19909</link>
		<dc:creator>Paul Kim</dc:creator>
		<pubDate>Sun, 08 Apr 2007 05:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19909</guid>
		<description>Ah, reminiscing about my days using DPS (Display PostScript). IIRC, chunks of the NeXT windowserver were written in PS making it especially interesting to dissect and hack. I also just noticed that 'pswrap' is still around (for DPS on X11).

I think reason #8 should be "It's fun". Maybe it's just me but I thought programming in PostScript to be pretty nifty. Something about playing with the stack. In a certain way, PostScript is like Logo for "grown-up" programmers.

Is there an interactive PS interpreter available? Something like &lt;a href="http://nodebox.net" rel="nofollow"&gt;NodeBox&lt;/a&gt;? I guess I should start playing with the DPS implementation on X11.</description>
		<content:encoded><![CDATA[<p>Ah, reminiscing about my days using DPS (Display PostScript). IIRC, chunks of the NeXT windowserver were written in PS making it especially interesting to dissect and hack. I also just noticed that 'pswrap' is still around (for DPS on X11).</p>
<p>I think reason #8 should be "It's fun". Maybe it's just me but I thought programming in PostScript to be pretty nifty. Something about playing with the stack. In a certain way, PostScript is like Logo for "grown-up" programmers.</p>
<p>Is there an interactive PS interpreter available? Something like <a href="http://nodebox.net" rel="nofollow">NodeBox</a>? I guess I should start playing with the DPS implementation on X11.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19896</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Sun, 08 Apr 2007 03:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19896</guid>
		<description>&lt;blockquote&gt;
  Hmmmm. I haven't actually programmed PS on the Mac. But wasn't one of the main drawbacks (or speed advantages) of PDF and Quartz that they cannot handle the full complexity of PS? Like those tiny files of PS code which will draw a Mandelbrot set, say
&lt;/blockquote&gt;

Yes; the idea was to make PDF more attractive for embedded systems (mainly printers and PSCs) that probably don't have the processing power to efficiently implement a full interpreted programming language. A Mac is not such a machine: it can handle full PostScript easily.

As for Quartz, that's what &lt;a href="http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPSConverter/index.html?http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPSConverter/Reference/reference.html" rel="nofollow"&gt;CGPSConverter&lt;/a&gt; is for.

&lt;blockquote&gt;
  And I keep being sceptical about the UI scaling argument. Yes, in &lt;em&gt;some&lt;/em&gt; situations, like Daniel's example, vector graphics may work well for use in the UI but in other situations, particularly at small sizes, hand-optimised graphics will just look better.
&lt;/blockquote&gt;

What I want is an NSImage subclass that DTRT for multiple representations. You could have a NSImage with a 24-px raster representation and a 48-pt vector representation, such that it would use the raster representation on low-resolution displays and the vector representation on high-resolution displays. Eventually, when nobody has a low-enough-resolution display to encounter the raster rep anymore, you delete that rep and go vector-only.

I tried writing a category that easily grabs all the representations of a file from a specific bundle and stuffs them into one NSImage, but it didn't work, as NSImage did the exact opposite of the right thing: it used my 48-pt vector rep for the 24-pt image well, and my 24-px raster rep for the 48-pt and 128-pt image wells. (This is with the same NSImage in all three wells.)

I'm open to sharing the code, if anybody wants to hack on it (perhaps by reimplementing -drawInRect:fromRect:operation:fraction:).</description>
		<content:encoded><![CDATA[<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>
  Hmmmm. I haven't actually programmed PS on the Mac. But wasn't one of the main drawbacks (or speed advantages) of PDF and Quartz that they cannot handle the full complexity of PS? Like those tiny files of PS code which will draw a Mandelbrot set, say
</p>
</blockquote>
<p>Yes; the idea was to make PDF more attractive for embedded systems (mainly printers and PSCs) that probably don't have the processing power to efficiently implement a full interpreted programming language. A Mac is not such a machine: it can handle full PostScript easily.</p>
<p>As for Quartz, that's what <a href="http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPSConverter/index.html?http://developer.apple.com/documentation/GraphicsImaging/Reference/CGPSConverter/Reference/reference.html" rel="nofollow">CGPSConverter</a> is for.</p>
<blockquote cite="http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-"><p>
  And I keep being sceptical about the UI scaling argument. Yes, in <em>some</em> situations, like Daniel's example, vector graphics may work well for use in the UI but in other situations, particularly at small sizes, hand-optimised graphics will just look better.
</p>
</blockquote>
<p>What I want is an NSImage subclass that DTRT for multiple representations. You could have a NSImage with a 24-px raster representation and a 48-pt vector representation, such that it would use the raster representation on low-resolution displays and the vector representation on high-resolution displays. Eventually, when nobody has a low-enough-resolution display to encounter the raster rep anymore, you delete that rep and go vector-only.</p>
<p>I tried writing a category that easily grabs all the representations of a file from a specific bundle and stuffs them into one NSImage, but it didn't work, as NSImage did the exact opposite of the right thing: it used my 48-pt vector rep for the 24-pt image well, and my 24-px raster rep for the 48-pt and 128-pt image wells. (This is with the same NSImage in all three wells.)</p>
<p>I'm open to sharing the code, if anybody wants to hack on it (perhaps by reimplementing -drawInRect:fromRect:operation:fraction:).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ssp</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19791</link>
		<dc:creator>ssp</dc:creator>
		<pubDate>Sat, 07 Apr 2007 22:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19791</guid>
		<description>Hmmmm. I haven't actually programmed PS on the Mac. But wasn't one of the main drawbacks (or speed advantages) of PDF and Quartz that they cannot handle the full complexity of PS? Like those tiny files of PS code which will draw a Mandelbrot set, say

Otherwise I guess the question comes down to how much you actually need to draw. I hardly ever needed to draw more than a few lines or shapes which standard NSBezierPaths did just fine (although not too quickly I might add – although I think this may have improved since X.2) 

And I keep being sceptical about the UI scaling argument. Yes, in _some_ situations, like Daniel's example, vector graphics may work well for use in the UI but in other situations, particularly at small sizes, hand-optimised graphics will just look better.</description>
		<content:encoded><![CDATA[<p>Hmmmm. I haven't actually programmed PS on the Mac. But wasn't one of the main drawbacks (or speed advantages) of PDF and Quartz that they cannot handle the full complexity of PS? Like those tiny files of PS code which will draw a Mandelbrot set, say</p>
<p>Otherwise I guess the question comes down to how much you actually need to draw. I hardly ever needed to draw more than a few lines or shapes which standard NSBezierPaths did just fine (although not too quickly I might add – although I think this may have improved since X.2) </p>
<p>And I keep being sceptical about the UI scaling argument. Yes, in _some_ situations, like Daniel's example, vector graphics may work well for use in the UI but in other situations, particularly at small sizes, hand-optimised graphics will just look better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Labovitz</title>
		<link>http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19777</link>
		<dc:creator>John Labovitz</dc:creator>
		<pubDate>Sat, 07 Apr 2007 20:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-04-07/why-mac-programmers-should-learn-postscript#comment-19777</guid>
		<description>Yes, totally. Having learned PostScript in the mid-1980s when it first appeared, I found learning Quartz and the Cocoa drawing classes to be really easy.  Sometimes I do miss the simplicity of "100 100 moveto (Hello world) show" (although I always forget that I have to set the font first).</description>
		<content:encoded><![CDATA[<p>Yes, totally. Having learned PostScript in the mid-1980s when it first appeared, I found learning Quartz and the Cocoa drawing classes to be really easy.  Sometimes I do miss the simplicity of "100 100 moveto (Hello world) show" (although I always forget that I have to set the font first).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.345 seconds -->
