Thread View: comp.lang.postscript
4 messages
4 total messages
Started by tvz
Wed, 26 Aug 1992 10:49
Defining a font vs. defining a procedure
Author: tvz
Date: Wed, 26 Aug 1992 10:49
Date: Wed, 26 Aug 1992 10:49
12 lines
911 bytes
911 bytes
Suppose that I want to put a star shape down at 100 or 200 points on a page. Which is better, to define a procedure that draws the star shape or to define a temporary font with the star shape? How much is the difference in terms of performance (memory/speed)? Thanks. Tim -- Timothy Van Zandt (609)258-4050 tvz@Princeton.EDU (NeXTMail) Dept. of Economics, Princeton University, Princeton, NJ 08544
Re: Defining a font vs. defining a procedure
Author: Dick Dunn
Date: Thu, 27 Aug 1992 07:05
Date: Thu, 27 Aug 1992 07:05
21 lines
1368 bytes
1368 bytes
tvz@zandtwerk.Princeton.EDU () writes: >Suppose that I want to put a star shape down at 100 or 200 points >on a page. Which is better, to define a procedure that draws the >star shape or to define a temporary font with the star shape? >How much is the difference in terms of performance (memory/speed)? With these parameters (and assuming that the star is not huge--i.e., that it's small enough to fit in the font cache) you are much better off using a font. The procedure gets executed--all the rendering and rasterization--every time. The only thing you really save is in using "bind" to save some operator lookups, and that's inconsequential compared to the character rendering time. With a font, the star character gets converted to a bitmap only once. That's most of the work. Then, each time you show the character, the bits just get blopped into the page bitmap. -- Dick Dunn rcd@raven.eklektix.com -or- raven!rcd Boulder, Colorado Cats!
Re: Defining a font vs. defining a procedure
Author: Peter da Silva
Date: Thu, 27 Aug 1992 13:00
Date: Thu, 27 Aug 1992 13:00
15 lines
1215 bytes
1215 bytes
In article <1992Aug27.070502@eklektix.com> rcd@raven.eklektix.com (Dick Dunn) writes:
>With a font, the star character gets converted to a bitmap only once.
>That's most of the work. Then, each time you show the character, the bits
>just get blopped into the page bitmap.
One downside of this is if you're rendering to a low resolution device (like
a video screen) you get the same defects for every iteration, and you'll get
regular positioning errors that look like a wave going down the page.
Like everything else, there are a bunch of tradeoffs.
--
`-_-'
Have you hugged your wolf today? 'U`
Peter da Silva, Taronga Park BBS, Houston, TX +1 713 568 0480/1032
Re: Defining a font vs. defining a procedure
Author: A Usenet Pal
Date: Fri, 28 Aug 1992 21:00
Date: Fri, 28 Aug 1992 21:00
21 lines
1593 bytes
1593 bytes
In article <DTPIBNI@taronga.com> peter@taronga.com (Peter da Silva) writes: >In article <1992Aug27.070502@eklektix.com> rcd@raven.eklektix.com (Dick Dunn) writes: >>With a font, the star character gets converted to a bitmap only once. >>That's most of the work. Then, each time you show the character, the bits >>just get blopped into the page bitmap. > >One downside of this is if you're rendering to a low resolution device (like >a video screen) you get the same defects for every iteration However, if you don't use a font you get different defects for every iteration. Rendering small objects at low resolution requires understanding device space and how to snap points into it. If you use a procedure, you have to do the snapping for each iteration; with a font, you only need to do it once. See Chapter 7, "Drawing Small Objects," in "Programming the Display PostScript System with NeXTstep" for the basic ideas. __ -paul asente \/ asente@adobe.com ...decwrl!adobe!asente moo-bear@cs.stanford.edu The most dangerous creation of any society is that man who has nothing to lose. -James Baldwin
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads