Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1988
Performance analysis of text-oriented printing using
PostScript
Thomas Kowalczyk
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion in Theses by an authorized administrator of RIT Scholar Works. For more information, please [email protected].
Recommended Citation
Rochester Institute of Technology
School of Computer Science and Technology
Perfonnance Analysis of
Text-Oriented Printing
Using POSTSCRIPT®
by
Thomas L. Kowalczyk
A thesis, submitted to
The Faculty of the School of Computer Science and Technology,
in
partial fulfillment of the requirements for the degree of
Master of Science
in
Computer Science
Approved by:
Guy Johnson
Professor and Chairman of
Applied Computer Studies
instructor
Dr. Vishwas G. Abhyankar
Frank R.Hubbell
instructor
Thesis Title:
Performance Analysis of
Text-Oriented Printing
Using POSTSCRIPT®
I, Thomas
L.
Kowalczyk, hereby grant permission to the Wallace Memorial
Libra.ry, of R.I.T., to reproduce my thesis in whole or in part under the following
conditions:
1. I am contacted each time a reproduction is made. I can be reached at the
fol1mving address:
82 Brush Hollow Road
Rochester, New York 14626
Phone # (716) 225-8569
2. Any reproduction
will
not be for commercial use or profit.
Date: October 10,1988
i
Apple, Appletalk,
LaserWriter,
andMacintoshareregisteredtrademarksofApple
Computer,
Inc.Fluent Laser FontsandGalileoRomanare
trademarksofCasadyWareInc.
Helvetica, Palatino,
andTimes areregistered trademarksofLinotype Co.ITC Avant
Garde,
ITCBookman,
ITCGaramond,
ITC ZapfChancery,
andITC Zapf Dingbatsare registeredtrademarksofInternationalTypefaceCorporation
POSTSCRIPTis a registeredtrademarkofAdobe
SystemsIncorporated.
Interpress ina registeredtrademarkofXerox Corp.
u
Abstract
POSTSCRIPT
isa pagedescription languagewhichisusedto transmitprinting information fromahostcomputer(i.e. AppleMacintosh)
toaprinter(i.e. Apple LaserWriter Plus). It hastheabilitytodescribepagesconsisting oftext,vector graphics,andscannedbit-map
images.Printing
textisthearea of concentrationforthis thesis.
Specifically
several variablesthataffecttheprintingspeed of a commonPOSTSCRIPT
printer,theAppleLaserWriterPlus,
arelookedatwhenprintingtext inavarietyoffonts,
sizes,and orientations. Thevariablesthataffectprinterperformance
include:
-use of outlinevs.
bit-map
fonts;
-theoutlinefontrasterizationprocess;
-the use ofpre-cached
bit-map
fonts;
- background
outlinefontrasterization;
-arbitrary scalingandrotation;
-downloading
host-residentfonts;
- Adobe
andThird
Party
host-resident downloadable fontsvs.printer-residentfonts;
- Appletalk
vs.RS-232communications
interfaces;
-useofthePOSTSCRIPTshow, ashow,and widthshow
instructions;
-targeting
thePOSTSCRIPTinstructionsataparticular engineresolution;- print engine overhead
AsequenceofPOSTSCRIPT filesweretransmittedto theAppleLaserWriter Plus printer. Theexperimentswerecarefullyconstructedtoexercizeeach ofthevariables
listedabove. Performancemeasurements werecarefullyrecorded and analyzed. Whereapplicable,improvementswereproposedtoimproveprinterperformance.
in
Tfl!?lP of
Contents
Page
Permission Statement '
Trademarks n
Abstract '
TableofContents iv
1. Introduction 1
1.1. Background 1
1.2 "PDL"Defined 1
1.3
History
ofInterpressandPOSTSCRIPT 21.4 AComparisonofOutlinevs.
Bitmap
Fonts 4 1.5Text,
VectorGraphics,
andBitmap
Images 81.5.1 Text 8
1.5.2
Bitmap
Images 91.5.3 VectorGraphics 10
2. ProblemDescription 13
2.1 VariablesthatAffectPerformance 14
problemdescriptionand expected results
2.1.1 Font Formats:Outlinesvs.Bitmaps 14
2.1.1.1 OutlineFontRasterizationand
Caching
152. 1.1.2 Pre-Cached Bit-Maps
15 2.1.1.3 Background Outline Font
Rasterization
16 2.1.1.4 EffectofScaling
andRotation17 2. 1.1.5 VariationsofFont
Style
19
TableofContents
(continued)
Page
2.1.2
Downloaded
Fonts 202.1.2.1 Downloaded Bitmapsvs. 21
PrinterResident
(Cached)
Bitmaps2.1.2.2 Adobe Downloaded Outlinesvs. 22
Printer Resident
(Internal)
Outlines2.1.2.3
Adobe
Downloaded Outlinesvs. 23Third
Party
Downloaded Outlines2.1.2.4 Appletalkvs.RS-232 25
2.1.3 Methodsof
Printing
Strings 262.1.4 Resolution"Targeting"
vs.Total 27
Resolution Independence
2.1.5 EffectofVaried Page
Complexity
onPOSTSCRIPT 28Processing
Time2. 1.5.1 EffectontheInter-PageTime
Delay
28Programsec
2.1.5.2 EffectontheCompilationandRasterization 29 ofTextPages
2.2 Performance MeasurementandCalculation 30
2.2.1 Communications 31
2.2.2 Interpretation
(Compilation)
andRasterization 352.2.3 PrintEngine Paper Ejection 44
2.3
Programming
Tasks 452.3.1 ExtractionofFont Widthsfrom 45
AppleLaserWriter Plus
2.3.2 Batch Composition Program 47
2.3.3 DownloadablePOSTSCRIPT
Bitmap
Font Program 492.3.4
Installing
DownloadablePOSTSCRIPT Outline Fonts 542.4 AssumedRIPArchitectural Model 55
v
TahlpofContents
(continued)
Page
3. AnalysisofExperimentalResults 59
3.1 Font Formats: Outlinesvs. Bitmaps 59
3.1.1 Red TimeOutlineFontRasterizationand
Caching
593.1.1.A ExperimentalResults 3.1.LB Analysis
3.1.l.C ProposedImprovements
3.1.2 Pre-Cached Bit-Maps 65
3.1.2.A Experimental Results 3.1.2.B Analysis
3.1.2.C ProposedImprovements
3.1.3 Background Outline FontRasterization 67
3.1.3.A ExperimentalResults 3.1.3.B Analysis
3.1.3.C Proposed Improvements
3.1.4 Effectof
Scaling
andRotation 713.1.4.A Experimental Results
3.1.4.B Analysis
3.1.4.C Proposed Improvements
3.1.5 VariationsofFontStyle 78
3.1.5.A Experimental Results 3.1.5.B Analysis
3. 1.5.C Proposed
Improvements
3.2 Downloaded Fonts 81
3.2.1 Downloaded Bitmapsvs.Printer
Resident
81(Cached)
Bitmaps3.2.1.A Experimental Results
3.2. LB Analysis
3.2.1.C Proposed
Improvements
3.2.2 Adobe
Downloaded Outlines
vs. 86Printer
Resident
(Internal)
Outlines
3.2.2.A Experimental Results 3.2.2.B
Analysis
3.2.2.C
Proposed
Improvements
vi
TableofContents
(continued)
Page
3.2.3 Adobe Downloaded Outlinesvs. 91
Third
Party
Downloaded Outlines3.2.3.A ExperimentalResults 3.2.3.B Analysis
3.2.3.C
Proposed Improvements3.2.4 Appletalkvs.RS-232 97
3.2.4.A Experimental Results 3.2.4.B Analysis
3.2.4.C ProposedImprovements
3.3 Methodsof
Printing
Strings 1023.3.A ExperimentalResults 3.3.B Analysis
3.3.C ProposedImprovements
3.4 Resolution "Targeting"
vs.Total Resolution Independence 111
3.4.A ExperimentalResults 3.4.B Analysis
3.4.C ProposedImprovements
3.5 EffectofVaried Page
Complexity
onPOSTSCRIPT 115Processing
Time3.5. 1 EffectontheInter-PageTime
Delay
Programsec 1153.8.1.A Experimental Results
3.8.LB Analysis
3.8.l.C Proposed Improvements
3.5.2 EffectontheCompilationandRasterization 118 ofText Pages
3.8.2.A ExperimentalResults 3.8.2.B Analysis
3.8.2.C ProposedImprovements
4.Conclusions 123
4.1 Scan
Converting
Outline Fontsvs.Caching Bitmap
Fonts 1234.2 Scan
Converting
Font Outlineswith"Quality
Hints"Applied 1244.3 FontStyle
Complexity
1244.4
Downloading
Fonts 1254.5 Methods of
Printing
Strings 1254.6 Resolution
Targeting
126vii
TflhiPofContents
(continued)
Page
4.7 Printer InducedDelays
127 5.
Glossary
6. References
133 7.
Bibliography
1. EquipmentandSoftware Tools
1.1 POSTSCRIPT Evaluation Equipment Configuration
2. Support Programs
2.1 PostScriptFont Widths
2.1.1 FontExtractionProgram
2. 1.2 Printed Font Width Tables fromtheApple Laser Writer Plus 2. 1.3 Times-RomanFont Width Table (AS CH
File)
2.2 GenerationofPOSTSCRIPTText Pages
2.2. 1 Batch Composition Pseudo-Code
2.2.2 Input Data"Content"File
2.2.3 Input
Markup
"Style"File2.2.4 Text PostScript File
2.2.5 Printed Textand
Timing
PagesfromtheAppleLaser WriterPlusviu
1. Introduction
1.1 Background
Anelectrtonicpublishingsystem
is
madeupofthreemainparts:thefront-end,
theRIP,
andtheprint engine.Figure 1.1is ablock diagramof atypicalelectronicpublishingsystem.
External
nformirin n fe-
Front
End
Page Description
Language^
RIP
Bit-Map
Engine
Input W Engine
w'
Control
Electronic
Publishing
System Block Diagram
figure
1.1
Thefront-endprovidesinterfacesto theuserandtoother computer systems. Theuserinterface
handles inputoftext,graphics,and
bit-map
(scanned) images,
and providesthemergingand pagelayoutofthesepiecesineitherabatchorinteractive(WYSIWYG)
mode. Thecomputerinterfaceprovides a communicationsinterfacewithotherinformationinputsystems(ie.word
processors,illustrationstations). This informationis filtered
by
thefront-endtoyieldthe internalpageformatoftheelectronicpublishingsystem.Ultimately,
theoutputofthefront-end isthe "pagedescriptionlanguage"(PDL)
filewhichissentto the"rasterimageprocessor" (RIP). The PDLfile describesthemarksontheprinted page.The Raster Image Processor
(RIP)
inputsaPDLfilefora pageora setofpages generatedby
thefront-end. The RIPthengeneratesthecorresponding
bit-map
image(s)
and sendsitto theprintengine,usually inarasterform. Theprint engine printsthe
bit-map
page.The Page Description Language
(PDL)
istheinterfacebetweenthe"softimage"worldofthe front-endandthe"hard-copy"world oftheRIPandtheprintengine. OneparticularPDLis quicklybecoming
anindustry
defactostandard: POSTSCRIPT.1.2 "PDL"
Defined
PDLstandsforPageDescriptionLanguage. ThetermPDLappliesto thesetofprinting
commandsthatdescribetheprintingoftextandusuallyvectorgraphics onaprinted page. The locationon apageisspecifiedanda"mark"isplacedatthatlocation. Thatmark canbea
dot,
a character, astringofcharacters,alinesegment, acurvesegment,or abit-map. The PDLhas noknowledgeof a"lineoftext"
or a"carriagereturn".
Subsequently,
conventionaltineprinters are notconsideredtousePDL's.Detennining
wherethelineoftextbeginsand ends isdie responsibilityofthefrontendapplication. AtypicalsequenceofPDL(pseudo)codetoprint out a simplestringoftextgoesasfollows:Movecursortothe
(x,y)
coordinateofthepage.Selecta
font,
size,andorientation;makeitthe"current"fontPrintthestring
"abc";
lettersareautomaticallyadvancedusingproportional spacing.Someofthemore recent
PDL's,
likePOSTSCRIPT,
offerfully
scalable androtatable outlinefonts. Theolder
PDL's,
likeimPRESS,
providealimitednumber ofdiscrete fontsizes andthefourquadrant orientations. The PDListhe
"assembly
language"
ofelectronicprinting. 1
1.3 HistoryofTnternressfind PostSPRTPT
(1)
Figure 1.3 showshowInterpressandPOSTSCRIPTbegan. Bob Sproullfirst developedaprinting languagecalled
"PRESS"
whileatXerox.
Independently
JohnWarnock developedhisowngraphics/printinglanguage. After comingtoXerox JohnWarnockputtogether asimilarprinting language hecalledJaM. AthirdconcurrentactivityatXeroxPalo Alto Research Center
(PARC)
wasthe"CedarGraphics" graphics research program."ResearchInterpress"
wasbasedon allthreeoftheseactivities.
Xeroxallowed someoftheirworktobecomepublic. Xeroxpermitted publicationof apaper basedontheworkconductedinthe"CedarGraphics"research program. Itwas written
by
John Warnockand
Doug
Wyattand was called"A Device Independent GraphicsImaging
ModelforUsewithRaster Devices".Secondly,
XeroxallowedLeoGuibas,
aStanford professor, touse someoftheInterpress-relatedresearch workascourse materialforacourseatStanford. John Warnockusedthepublicinformation disclosed
by
Xerox inadditiontodieworkthathedidpriortocomingtoXeroxasabasis for starting hisowncompany,
Adobe
Systems,
Inc.,
andcontinuedthedevelopmentofalanguagewhichhecalled POSTSCRIPT. TheApple Laser Writerwasthe firstcommercial producttousePOSTSCRIPT. The definitionofPOSTSCRIPTispublic. Adobe'sproductistheir
implementationof
POSTSCRIPT,
whichthey
willporttoahardware RIPthateitherAdobe orAdobe'scustomerdesigns.OntheInterpressside, a subsetofResearchInterpresswaschosen whichbecamethe Xeroxinternalstandardlanguagethatwascalledthe"Interpress'82Electronic
Publishing
Standard".
Printing
instructionswereaddedtoInterpress '82tobecomeanotherXerox internalversionofInterpress,
version2.0. Xeroxmadeversion2.1 publicin Aprilof1984. In
1986,
Xeroxreleased Interpress version3.0whichcontainedthreesets. The "Commercial Set"handles basictextandtrivialgraphics; the"PublicationSet"addsbit-map
fonts,
vectorgraphics,andbit-map
printing;the "Professional GraphicsSet"provideshigh
functionality,
likescaledand rotatedoutiinefontsandbit-map
imageprocessing. ThePublicationSet"isamedium
functionality
language similarto"imPress",
alanguage developedand sold
by
ImagenCorp. The "ProfessionalGraphicsSet"isahighfunctionality
page description languagesimilartoPOSTSCRIPT.Muchofthisinformationwastakenfromreference#1. (Referencelistmaybefoundinsection
6.)
Section 1.1
1976: WhileatEvans&*
Sutherland,
John Warnockworks ongraphics algorithm
researchforflightsimulators
Bob Sproulldevelops
PRESSatXerox
Late70's-earlv8Q's
Xerox PARC "Research Interpress" headed
by
Chuck Geschke John Warnock develops.JtbeJaMgraphics print
ing
language"CedarGraphics"
graphicsresearch
program
PRESS implemented
andusedinside Xerox
Leo Guibasconduct^
Interpressresearch
atStanford
July
1982 John WarnockF&
Doug
WyattPublish'"A Device Independent
GraphicsImaging
ModelJ
forUsewithRasterDevices"
January
1982 Xerox InternalStandard"Interpress'82Electronic a .Publishing
Standard"
Add"printing"
instructionsto
Research Interpress&
Interpress '82
John Warnock
and
ChuckGeschke
startAdobeSys.
InternaltoXerox:
Interpress2.0
1985:
FirstPOSTSCRIPT
Product
AppleLaser Writer
1986:
Apple Laser
Writer Plus
othersinclude
QMS,Mergenthaler, DataProducts,...
jr April 1984 >w
/
Public:Interpress\
1 ElectronicPrinting
J
V
StandardJ
\Vali/
Commercial
-?Set
1986
^N.
/
Interpress3.0\
PublicationI releasedto r~
"?"Set
V
publicJ
AnnouncedXerox^^7++^ Prof. Graph.
printerstosupport
/
"-?Set
Interpress include J*
4045, 4050, 9700,& 8700
History
ofInterpress
andPOSTSCRIPT
figure 1.3
1.4 A Comparison of
OutHfif
YS KiHnanFontsBefore POSTSCRIPTwasintroducedmost printers couldonlyuse
bitmap
fonts. Oneofthekey
capabilitiesofPOSTSCRIPTthatcertainly setAdobeSystems,
Inc.ahead ofthecompetition wastheextensive use of outlinefonts. Thisis inadditionto thelessused
bitmap
fontfunctionality. Outline fonts have manyadvantagesoverbitmaps. Fourofthemore importantadvantages areoutlinedbelow.1. Resolution Independence .
Sinceafontoutlineisnottiedtoaspecificresolutionoutput
device,
thesameoutlinecan easily beusedtodriveanyresolution outputdevice.For
bitmap
fonts,
entirely different bitmaps arerequiredforprinters withdifferent resolutions. Forexample,a300 dpi fontwillbe 75% size when printed ona400 dpi printer,or 150 % size on a200dpiprinter.2. Device Independence
Differentprintershave differentprocessesthat
lay
blackmarksonapage. Insomecases eveniftwoprinters ofthesame resolution printtheexact samebitmap
(font) data,
theoutput canappearsignificantly different. Inthecaseofelectrophotographicprintersatight (laserorLED)
exposes an area of electrophotosensitive material. Theprocessissetupsuchthat the exposed area eitherpicksup toner, ina"writeblack"
system,ordoesnotpickup toner, ina "writewhite"
system Ifthesame
bitmap
isprintedontwoprinters withdifferent polarity processestheprint produced with "writewhite"
tendstobe lighterthanthe printproduced with"write black". Inconsistencies acrossprinterscanbecompensatedfor intheoutline font renderingalgorithm,sothatthesamebasicoutlinecanbeusedtoprint ondifferent process printers.
Incontrast,tomake
bitmap
fonts lookthesame onprinterswithvery differentprocesses, differentfont bitmaps are needed.3. Betterselection ofhigh quality rotated andscaledfonts
Asinglefontoutline canbe scaledtoanysize and rotatedtoanyangle. Inadditionitcanbe "obliqued"
ortiltedor reflectedineither orbothaxes. Inshort,anyoutlinefontcanbe transformedinawaythatcanbedescribed
by
any lineartransformation.By
comparisonbitmap
fontsare applicablefor onlyone size and orientation(andresolution andprocess). A 12pointfontcontainsanentirelydifferentset ofbitmapsthana 10point fontofthesamefontstyle. Thenextsection(4)
discusseswhatthismeans relativetofont storage space. Anothermethodofprinting bitmapsistouseoneorseveralbitmapsand scalefromthenearestbitmap
fontavailable. Althoughthismethod saves storage space and communicationsdownload timethequalityofthefont is severely degraded.4. More memoryspace efficient.
Anoutlinefont isspecified at onesize,
typically
ona 1,000by
1,000unit gridforPOSTSCRIPT. Theoutlinedescription foreachcharacter ofthefont isspecifiedrelativeto discretepointsonthisgrid. Theseoutlines are madeupofstraightlinesegmentsandbezier curve segments. Charactersinthisfontarethen
fully
scalableandrotatablefor anysize,resolution,and orientation. Anoutlinefonttakes
approximately
30KBytes
ofmemory'
space. Forexamplethesize oftheAdobe
POSTSCRIPT
StoneSerif
downloadable
font is 34,260bytes(*)
whenstored onthehostMac Ucomputer. Oncethefont isdownloaded
it ispackedinsidetheAppleLaserWriterPlusinaslightlymorecompact mannerand occupies28 KBytesofRAM**.*
measuredwiththeGet Info utilityoftheApple
Macintosh
Finder ** measuredwiththePrinter FontDirectory
function
oftheFontDownloader
program4
By
contrastabitmap
font only describesatypefacerendered at a singlesize, resolution,and orientation. Ifa 10point anda 12pointfont
are needed(say
at a givenresolutionand orientation)then twodifferent files
mustbecreated and storedforthebestquality. One size canbescaledfromtheother(see #3above),butthisyieldsverypoor results.The size of a
bitmap
fontvaries asthesize ofthefontandtheresolution varies. For exampletakea 12pointfontwith96printable characters at a300 dotperinchresolution. Thelargest
possiblebounding
boxof a 12pointfont is 12points wideby
12pointhigh. Thiscanbecalculatedtobe 50 dots:12points * 300 dotsperinch = 50 dots izpoints
72points perinch
Sothe 12point
by
12pointboxwhentranslatedinto dots isa50 dotby
50dotcharacterbounding
box. Thisrepresents2500dots,
each of which canberepresentedby
onebit,
assumingthedot isbitonal(i.e. BlackorWhite). 2500bitscanbestored as313bytespercharacter. Onaverage the charactersonly occupyabout onethird ofthisspace,soittakes
approximately 104bytestostoreeachcharacter's
bitmap
alone. For96charactersthis rums outtobeabout 10 Kbytestostorethebitmapsofafull96characterset Additionalfontinformationwhich cantakeseveralKBytesalso needstobeincludedalongwiththe
characterbitmaps. Anexampleofthiskindofinformationisthecharactermetricsofafont (i.e.width,
height,
kerning
info). Ifthisinformationtakes4KBytes,
then thehypotheticalfont describedabovewillneed 14 KBytestostore a single sizeofonefont. Thereare other factorswhichinfluencethesize of
bitmap
fonts.Depending
onthecombination ofthe sizeand resolution ofa
bitmap
font,
theeffect ofscalingafontwillhavevaried results. Three(size-resolution)
"regions"arelookedatinmoredetail below:Low
(Size-Resolution)
"Region"Thisregioncanbeactiveunderthreeconditions:
1. smalltomediumpoint sizes are selected(e.g.
10, 12, 14);
2.
(screen)
resolutionsofapproximately 75dotsperinchareused;3. themethodofstoringthebitmapsuses
"Byte"
or"Word"padding.
Atthesesize-resolutioncombinationstheaveragecharactersallfitwithinonebyte(of
width). The 12point
bounding
boxis approximately12 dotsby
12dots atthisresolution. Ifthewidthoftheaverage characterisonehalfofthis,thecharacteris 6
dotswide. With"byte
padding"
the
bitmap
ofthischaracter wouldbestoredas acolumnofbyteswiththerightmosttwobitsofeachbytepaddedwith zeroes.
Using
the sameassumptions a 10pointfontwouldhavean average characterwidthofapproximately5
dots;
at 14point,7dots. Inthisregion,asfonts are scaledthesize of storageneededscaleslinearly,
not geometrically. Thisis because onlytheheightofthefontchanges(morerows)butthewidthdoesnot(mostcharactersfitintheonebyte).
Notethateventhoughthebitmaps scale
linearly
inthisregion,thespace requiredtostoretheconstant metricinformationoftenoutweighs theamount of storage space
neededforthevariable
bitmap
data.Nospecificexampleisprovidedtodemonstratethiseffect
5
Medium
(Size-Resolution)
"Region"
Thisregion canbeactive under eitherofthe
following
twoconditions:1. Nobytepadding (i.e.one character's
bitmap
runsintothe next);or
2. Byte paddingisused with
-smalltomedium point sizes (e.g.
10, 12, 14);
-(printer)
resolutions ofapproximately300dotsperinch.Inthefirstcase,ifnobyte paddingis usedboththewidthandheightchangeasthefont size changes. Thesize thereforescalesquadratically(asthesquare).
Inthe secondcase,ifthesize-resolutioncombinationis largeenoughsotheoverhead
incurredwithbyte padding becomesnegligiblethen,onceagain,thefontsize scales
quadratically. As discussedearlierinthissectionthe 12point
bounding
boxis 50 dotsby
50 dotsatthis resolution,sotheaverage characterisabout25dotswide. Withthis size-resolution combinationamuch smaller percentage oftheinformationisbyte padding,soas thesize ofafont increasesthespaceneededtostoreit increases intwodirections. The formulathatbetterexplainsthisphenomenais:
y=x2 + b
Notethat the space requiredtostoretheconstant metric
information,
specifiedasbabove,isquite substantial.
Macintosh
bitmap
fontsarestoredin memorywith each characterbutting
upto the next character allhaving
a constantheight Bytepaddingisnotused. Toshowthat the(variable)
bitmap
portionofthescreenfontscalesgeometricallywithfontsize,the12pointand24pointTimes Roman screenfontswereexaminedusing ResEDIT (a Macintoshresourceeditor).
PointSize TotalSize*
Bitmap
FontSize** Metrics,etc.**12 7,570bytes 1,752bytes 5,818 bytes
24 12,730 bytes 6,912 bytes 5,818 bytes
* Measured
withtheFont/DA Mover utilityprogram. **
MeasuredwithResEDIT.
Macintosh Times Roman Screen Font
Figure 1.4.1
b=5,818
x=
(
point size/
12)
*V
1,752=41.9/ortheTimes Roman
screenfontItisclearlyshowninthefigure 1.4.1that the
Bitmap
FontSize
scalesquadratically
with thepoint size. Thesize ofthebitmap
portion ofthe24pointfont isalmostexactlyfourtimesthatofthe12pointfont (within 1.4%errordueto rounding). Seereferences29 and30formoreinformationonthe
Macintosh
sreenfontformats.
High
(Size-Resolution)
"Region"Asthe
(size
*resolution)product getsmuchlargerthebasiceffectonthe
bitmap
storage neededcontinuestoberiseexponentiallywiththesizeofthefont.However,
whenthebitmaps
get muchlarger,
they
aregenerallycompressed. Atypicalcompression schemeisonecalled
"run-length
encoding". Thesimple onedimensionalversionofthis compression schemesimplystoresthenumber ofwhiteandblackpixelrunsforeach scanlineoffontbitmap
data. Moresophisticated schemes allow compressionintwodimensions.
Theobvious advantage tousing datacompressionisthatisreducesthe amountofdatastoragespace needed. The disadvantage isthatmoretime (andorhardwareassist)isneededtoprocessthedataonbothends: compressionand
de-compression.
"Compressed
characters consumemuchlessspace.. thanfullpixelarrays(by
factors ofupto
40),
butrequiremore computationtoreconstitutewhenyou needthem.Reconstituting
acompressedcharacterisstillsubstantially fasterthanre-executingtheoriginal characterdescription." IntheAppleLaserWriterIIntx bitmapsoffontsthat
arelargerthan20pointsinsize are storedincompressedformat (all Ref.
2)
7
1.5 Text. VectorGraphics,andBifmanImages
The POSTSCRIPTpagedescription languagehasinstructionsthatallowstheusertodraw text,
vectorgraphics,and
(scanned)
bitmap
imagesonapage. Thisthesisconcentratesontext and doesnotaddressthevectorgraphics andbitmap imaging
areasinany detail.However,
many
real-lifeapplications,likeelectronicpublishing,regularlyincludethesetypesofimages. POSTSCRIPT isveryrich invectorgraphicsandbit-map imaging
functions. Itwouldbemisleadingtonot even mentionthemina paper such asthisone.
Therefore,
topresent amore completepictureofPOSTSCRIPT,
allthreewillbe discussedbriefly
here.1.5.1 Text
Text is generallythesimplestmostefficientand mostused
"mark"
thatisputonthe page. Onceafont is definedwithastringlike
/Times-Roman
findfont12scalefont setfont most ofthePOSTSCRIPTprogramconsists oftheactualstrings ofcharacters. Insimplelineprinterstheonlyoverheadisthecarriage return- line feed characters
delimiting
linesoftext. ThiscanbetwoACSIIcharacterspereach100character (orso)lineoftextor2%overhead. WithPOSTSCRIPTtheoverhead can
varywidely, duetoPOSTSCRIPT's diverse functionality.
But,
fora simplelineprinter emulation,theoverhead oftextualPOSTSCRIPTcanbemadewithafewsimpleassumptions:
1.asinglepositioningcommand,like 72 720moveto,willbeused perlineoftext;
2.the stringsoftextwillbeencapsulatedinparentheses,andfollowed
by
theshowcommand;
(
thisisastring oftext)
show3. 100charactersperaverage
line;
4.thenumberoftinesare sufficiently largesuchthat the overheadincurred
by
theinstructions
selectingthefontcanbeignored;
5. additionallyonecarriagereturn- line feed
pairperline isused
Withthese assumptionsthereare22charactersper100charactersofoutputtextor22% overhead. A verydensepageoftext
containing
4,000characters,canbe
described by
approximately
4,900charactersofPOSTSCRIPT
code.Since
POSTSCRIPT
isafullprogramming
language,
asimple program that emulates thecarnage return- line feed function
canbe
defined
inthebeginning
ofthefileand accessedby
callingthatfunctionwithasingle character(i.e.thenameofthefunction)
after eachstringoftextisspecified.
Using
this methodthe overheadcanapproach3 % ignoringimnalizationoverhead, and
assuming
onematching
pairofparenthesesone character
(c,
below)
which callsthecarriagereturn- line
feed function:
initialization includes:
-specifyingthe
font
-defining
thec(carriagereturn- linefeed)
procedure*-positioningthefirst lineoftext
(first stringofcharacters
)c(
secondstring
ofcharacters)c(
thirdstring
ofchar)
Generally,
asthecomplexity
ofthe textincreases,
though,
sodoes
theoverheadof
describing
thattext Muchmoreissaid aboutte"xtthroughouttitis
^thesis
8
Section1.5
1.5.2
Bitmap
Images
Ontheotherendofthespectrumofefficiencyand speedare
bitmap
images. Iftheentire page weredefinedby
abitmap
image
thatmatchestheresolutionoftheAppleLaser Writer Plusprint engine(300dotsperinch),
itwouldtakeover8 Mbitsor 1 MByteofbinary
data. That's90,000
bits persquareinch! Theoverhead ofPOSTSCRIPT forimages
ismuch more severethanfortext Asinglebinary
byteofimagedata isdescribed
by
twoASCIIcharactersthatspecifytwohexadecimalnumbers. So 1 MByte ofbinary
data isdescribed
by
2 MBytesofASCII-encodedhexinPOSTSCRIPT,
or100% overhead.
Fortunately
onedoesnotnecessarilyneedtospecifythatmuchdatatofilltheentirepagewith a
bitmap
image. This isbecause POSTSCRIPT:
-isresolutionindependent The
input
image doesnothavetomatchtheoutput300dpi resolution. ThePOSTSCRIPT image
operatorautomaticallyadjuststheinputto outputmapping forprinterswithtwodifferentresolutions(say
300dpiand600dpi).The inputcanbepresentedtotheRIPin anyresolution.
- allows
scalingofallimages(whether
they
aretext,graphics,orbitmaps). Animagescannedfroma 1 inch
by
1 inchimagecanbescaledtoanysizeontheoutput. Infactany lineartransformationcanbespecifiedwhichcan:
scaleinxandy
by
thesame amount(1inchby
1 inchscalesto7inchesby
7inches);
-anamorphicallyscaleinxandy (1 inch
by
1inch scalesto3inchesby
7inches);
-"tilt"
theimage(rectangularimagebecomesanimage
fitting
aparallelogram);-rotatetheimage. Imagescan alsobe scanned as
"contone"
images (i.e.morethan 1 bitperpixel;
typically
8 bitsper pixelformonochrome). Sincetheoutputimagecannot printgreydots
matchingthegreyareasofinput
image,
amappingofgreyvaluestoblackandwhite printabledotsmustbemade. This mappingiscalledscreening. VariablesthatcanbesetwithPOSTSCRIPTare:
-frequency
*ofthescreen. Thisisthenumberof"halftonedots",
or"super-pixels",
areprinted perinchontheprinter. Eachofthesehalftonedotsrepresent agreyvalue(orsetofgreyvalues)fromtheinputcontoneimage.
-angle *ofthescreen. This specifiesthenumber ofdegrees
by
whichthehalftonescreenistoberotatedwithrespecttothedevicecoordinate system.
-spotfunction*ofthehalftone dot. This specifieshowthehalftone dot istobe
"grown"
astheinput greyarea changesfromwhite(noblackpixelsturnedon)toblack (all blackpixelsturnedon).
Specifically,
a procedureisspecifiedwhichdescribesthe orderinwhichpixels withinahalftonecellare whitenedtoproduceany desiredshade ofgrey,(setscreen,
reference3)
- input
tooutputtransferfunction. Aprocedurecanbespecifiedwhichmapstheinput greyvaluesto theprintergreyvalues,whichisafractionof allpixelsthataretobe
whitened,
(settransfer,
reference4)
Thetwogreatestperformancebotdeneckswhen
dealing
withimageswithPOSTSCRIPT are:
1. accessingtheimage. Imagestendtobelarge. Ifacommunicationsline isused,it
simplytakes a
long
timetodownloadtheimage. POSTSCRIPT's method ofencodingtheimagewithASCII-encoded
hex,
describedonthepreviouspage,slowsdownthisprocess
by
afactoroftwo. Forexample a256 KBytebinary
image,
which when encodedthiswaybecomes512KBytes,
takesalmost9minutes todownload
usinga conventionalRS-232serialinterfacelinerunningat9600 baud. Evenwhen theimage isresidentinsidethe
RIP,
sayon adisk,
once againduetothesize oftheimage itstilltakesarelatively
long
time toretrievetheimage fromdisk,
andtousethediskas a
backup
scratch padwhenprocessingtheimage.Thisbottleneckcanbe diminished
by
using fastercommunicationsinterfaces,
fasterdisks,
and moreRAM. Ocourse,alongwiththeseRIPenhancementsusuallycomes ahighercost.2. processingtheimage. Theprevious page summarizestheimage processing
functions
thatcanbeappliedtobitmap
images. Asinall ofPOSTSCRIPT,
thefunctions
vary from verysimpletoverycomplex.
Applying
aparticularimage processing algorithmtoanimagetakesanamountoftimethatisloosely
proportionalto the "complexity"oftheimage processing functionselectedand,you guessed
it
the size oftheimage.*evThisbottleneckcanbereduceby: ,
-onceagain,moreRAMand/orfaster
disc;
-fastergeneral purpose
CPU;
-computerarchitecturethatbettersuitstheimage processingalgorithmsthatare
commonlyused. This caninclude specialpurposehardware.
1.5.3 Vector
Graphics
Somewhere
inbetweentextandbitmap
images liesvectorgraphicsinspeedand efficiency. Asinglestraighttinethattraverses theheightand width of a page canbe describedinjustafewPOSTSCRIPT instructions:
J
mveto %set cursortolower
leftcomerof page 612792Iineto % draw linetoupperright
comer,coordinatesarein
stroke % "points"
or1/72 inch
NowtheRasterImage Processorneedstofillallofthepixelsinpage memorythat
correspondto thepixelsthatmakeuptheblack line. Othersettingsthateffectthe
renderingof
(connected)
lines are:
-width ofthe
line,
setablewiththesetlinewidthoperator;JOin'
WWCh CanbCmlter' IOUnd'OTbCVel;
Settable***Aesetlinejoin
"
^^
^
^^"Pn>jeCtedSquare; **********
10
Section1.5
Insteadofthe simple sequenceof
instructions
shownabove, apathconsistingofmanyshorter
lines
segments,all connectedtogether,which definethesame resultantlinecouldalsobespecifiedin
POSTSCRIPT.
Eventhoughthesame exactbitsareturnedone, thisproblemis
significantly
moredifficult foratleasttworeasons:1. more
POSTSCRIPT
code needstobereadandinterpreted;
2. each small
line
segment needs notonlytobedrawn,
butconnectedto thenextlinesegmentinsuch a mannertomakeitappearas onecontinuousline.
Othergraphical shapes canbespecified:
-circualar arcsegments
(arc,
arcn, reference5)
;- Bezier
cubic splinesegments
(curveto,
reference6)
;inadditiontostroking
(drawing)
alineorcurvedsegment,an areathatis describedby
a sequenceofthesesegments canbe filledwithblackorsomehalftonepattern correspondingtothe selectedgreyvalue.(stroke,
strokepath,reference7 ;fill,
ref.8 ; eofill,ref.9; setgray,ref. 10)
Inadditionto
drawing
orfilling
thepathsthataredefined,
thesesame paths canbeused tospecify aclippingboundary
throughwhich othertext,vectorgraphics,orbitmap
imagesareclippedbeforebeing
renderedinpagememoryandsubsequentlyontheprintedpage,
(clip,
reference11)
OnceagainPOSTSCRIPT givestheuseralmostlimitless
flexibillity
for printingvectorgraphics. Boththe amountofPOSTSCRIPTcode aswellastherendering compexity canvarywidely. Ihavenodoubtthatsimilar paperstothis onecouldbewritten with concentrationonperformanceaspects of vectorgraphicsor
bitmap
imaging
insteadof textHopefully,
thisbriefsectionhasprovidedthereader with some appreciationfor thenumberandmagnitude ofissueswhendealing
withPOSTSCRIPTvectorgraphics andbitmap
images.11
12
2. Problem
Description
Therearemany
different
ways ofdescribing
a page oftextinPOSTSCRIPT. Howonedescribesapagecan
significantly influence
theoverallperformanceoftheprintingsystem. Thevariablestobe
investigated,
alongwiththe expected outcomeoftheexperiments, aredescribed insections2.1.1through
2.1.8
. Theexpected resultsarebasedon assumptions oftheRIParchitecturalmodeldescribedinsection2.4.
Sections
2.1.1 through 2.1.5match with sections3.1 through 3.5. The lattersectionsdealwiththespecificexperimentalproceduresused,theresultsthatareproduced,analysis oftheseresults,andproposals, ifany,on what changescouldbemadetoimprove
performance.
Foreachvariableinquestion,a set ofbenchmarkpages are generatedtodemonstratethe
significance ofthevariable.
Many
ofthebenchmarkpagesareincluded insections 3.1through3.5. Duetospaceconstraints,benchmarkpagesthataresimilartoones
included,
but different in somesmallway,aredescribed,
butnotincludedasinserts.Section 3.2 specifiesthemethodsusedin calculatingandmeasuring timestakenforthedifferent
phases ofthe
RIPing
process,namelycommunications andthecombinedcompilationandrasterizationtime. Theprogramswrittentosupporttheexperiments performedforthis thesis are
explainedinsection3.3 with
backup
informationprovidedin Appendix2.Onceagain, section3recordstheexperimentallymeasured
times,
analyzesthesetimes,
and suggestsimprovements to theRIParchitectureand/ortothePOSTSCRIPTlanguage itselfthat might yieldbetterperformance.Section 4presentsoverallconclusionsusingalloftheinformation in section3tocomment onthe generaltrendsthatwereobserved.
13
2.1 Variablesthat AffectPerformance
TherearemanydifferentwaysthataPOSTSCRIPTprintercanbeinstructedin howtoprint textona page. Somevariables which affect system performance arelistedmthe
following
sections.
2. 1.1. FontFormats:Outlinevs.Bit-Maps
Problem Description
Rasterizing
afontoutlinetakesmuchmore timethan copying(BLT-BlockLogicalTransfer)
afontalready inbitmap
formto thepagebuffermemory. Thereis atendency
touseonlyasmall number ofdifferentfonts(atacertainsize andorientation)inany givenwritten work. Infactit isconsidered"goodstyle"
tolimitthenumberof
fonts
and sizestojustafewwithinany document.Furthermore,
whenusinganygivenfont,
most ofthetimethewriter usescharacters ofthealphabetthathavebeenusedbefore. Forexampleiftheletter "a"
isused20timesonasinglepageinthesamefont itneedsonly toberendered once andisrepeated 19 times. Inthis casetheleter"a"
isrepeated
95%
ofthe time. Repeatuse offonts and of characters withinafontarethetwoprimary reasons whyallPOSTSCRIPTprinterstodatehaveafontcachewhichstoresthescan convertedfontsfor lateruseinthefaster
bitmap
form."Printing
acharacterthatis already inthefontcacheistypically
athousandtimesfasterthan scanconverting itfrom thecharacterdescription in diefont"(reference
12)
. Thetimeconsumingprocess ofoutlinefontrasterization canbe doneatvarious
times,
influencing
theprinter's performance. Thissectionlooksatthreeoftheseparticulartimes:1. insideaPOSTSCRIPTprogram,when a new non-cached characteris specifiedtobeprinted;
2. once atthe"factory"wherethebit-mapsarepermanentlystoredinnon-volatile memory,
typically
sometypeofROM;
3.
during
idletime. WhentheRIPisnotbusy
generatingpagesitcanperformthetimecorisumingfontoutline rasterizationtask.
Thesethreearelookedatinmoredetailinsections2.1.1.1 through
2.1.1.3,
respectively. Thecorrespondingexperimentalprocedures,results,and analysiscanbe foundinsections3.1.1 through3.1.3.
Section 2.1.1.4anditscomplementsection3.1.4 dealwiththe performanceeffects of
scalingandrotatingoutlinefonts. Since detailedperformance measurements
willbe
done insection
3.1.4,
theprintjobforthis experiment containsno repeat characters. Thisistheonly waytoisolatethescanconversion processfromthebitBLTing
(moving
bit-maps)
frombit-map
cache. Moreonthisinsection3. 1.4.14
Section2.1.1- Problem
2.1.1.1 Real Time
Outline
Font RasterizationandCaching
During
thecourseof atypicalPOSTSCRIPTfile,
fontsresidentinoutlineformare specifiedtobe scaled,(possibly)
rotated,and printed. Whenthis occurs thefirst printusingthesefonts
tends tobeslowdueto thetime consumingtaskofin-line (orreal
time)
scanconversionoftheoutlinefonts intothefasterbit-map
form.ExpectedResults
The firstpageafter a powerupsequenceprintingafontthathasnotbeenstoredin
bit-map
form isexpectedtobeslow. Oncethisfirstpagehas beenprinted,all ofthe fontsonthatpagewillhave beenstoredintheRTP'sbit-map
fontcache.Subsequent
pagesareexpectedtoprint at a muchfasterrate,assumingtheprinteris keptpowered-up.2. 1.1.2 Pre-Cached Bit-Maps
Ifthetimeconsumingprocessof outlinefontrasterizationis donebeforethefont is requestedinthePOSTSCRIPTprogram, substantialperformance gainscanbe realized. Thissectiondealswiththecase wheretheoutlinefontrasterizationis done
once"atthefactory"andtheresultantbit-mapsofaselectfewfontsare storedin
non-volatile
bit-map
fontmemory,suchasEPROMinthecaseoftheAppleLaser-WriterPlus.
ExpectedResults
Pagesthatprintfontsthathavebeenpre-scanconverted andpermanendystoredin
ROMare expectedtoyieldequivalentperformance whetherthepageisthefirstone afterpowerupornot. Thetimeconsumingoutline scanconversionhas beendone once, atthefactory. The REPneednotbeboggeddownwiththis task.
15
2. 1.1.3 BackgroundOutlineRasterization
Whileapage printerisinthepowering-up state,theuseris
typically
forcedto waituptoseveral minutesbeforethefirstpage canbeprinted. In laserorLED electrophotographic printersmuch ofthis
delay
is dueto thetimeittakesforthefuser
heating
elementtoriseuptoitsrequiredtemperature.During
a portion ofthistimetheRIP usuallygoesthroughaninitializationanddiagnosticcheckingphase.
Oncethisis
done,
theRIPmust wait untiltheprint engineis
readytoaccept aprintjobfromtheRIP. Thisis oneexampleof idletime. Anotherexample ofidle time isthetime in between jobs. Ifthetime consumingprocessof outlinefont rasterizationis donebeforethefontisrequestedinthePOSTSCRIPTprogram,say
during
thisidletime,
substantial performancegainscanberealized.Expected Results
SeveralfontsintheAppleLaserWriterPlusarescan convertedfromthereoriginal outlineformto
bit-map
formand storedintheREP'sfontcachememoryduring
idle time. The POSTSCRIPT Language Reference Manuallists severalfontsand sizes at azerodegreerotation(i.e.portraitorientation)thatareautomaticallyscan convertedduring
idle time (reference13)
.They
includeall ofthealphanumerics andcommon punctuation ofthe 10and14pointTimes-RomanandHelveticafonts,
and alsothelowercaselettersofthe10,
12,
and 14pointTimes-BoldandHelvetica-Bold fonts. Inaddition,an extensionto thePOSTSCRIPTpage
description languagehasbeenspecifiedfortheAppleLaserWriterPlus
toallow
thePOSTSCRIPTprogrammertospecifywhichfonts he orshe wouldliketobe
scan converted
during
theprinter'sidletime. The setidlefonts operator allows theselectionofone ofthirteenfontswithadifferentxandypoint size selectableintenthsofa point
increments,
and an angle selectableinincrementsoffive degrees(reference
26)
.Printtimesforpagesthatusethe 10pointHelveticaand the 14point
Times-Roman fontswillbe lookedat The POSTSCRIPT files containing referencesto thesefontswillbe sent atvaryingtimesafterthepower-upsequenceis
begun. Thiswillbedone
by
simplytirrning
theprinter off andthenbackon. It isexpectedthatifajobusinganidle timescan convertedfont issent
immediately
to the printerfollowing
a powerupsequence,itwilltakelongerthanifsometime iswaitedbeforethisisdone. Theexperimentsarereportedinsection3. 1.3.
16
Section 2.1.1.3
2. 1.1.4 Effectof
Scaling
andRotationSection 2.1.1.4anditscomplementsection3.1.4 dealwiththeperformance effects
of
scaling
androtatingoutlinefonts. Page 91 ofthePOSTSCRIPT LanguageReference
Manualstatesthethe"built-inPOSTSCRIPT(outline)
fontsareusuallydefined
intermsof a 1000unit character coordinatesystem,and theirinitialFontMatrix
is [0.001 0 0 0.001 0 0]. Whenafont ismodifiedby
the scalefontor makefontoperator, thenew matrixisconcatenated withtheFontMatrix
toyield atransformedfont." InotherwordstheFontMatrixmaps afontinthe 1000unit spacetoa one unit spacescalingthexandyfontunits
by
1/1000withthe
following
matrix:0.001 0 0
0 0.001 0
0 0 1
Thismatrix scalesbothxandycoordinates
by
1/1000. SeethedefinitionofCTMinthe
Glossary
(section5)
formoreinformationonthevariablesof agivenmatrix.Sincethe defaultunitin POSTSCRIPT isthepoint,thismeansthatifanygivenfont isnot scaled
by
somemeans,itwillprint out at a1point size. Thereforeall usablefontsthatarescanconvertedfromoutline are
initially
scaled. Thetimeconsumingmatrixmultiplicationstepmust alwaysbe done. Thesecondpartofthescan conversion processinvolvestherasterization,orrendering,ofthetransformed
(scaled,
etc.)fontoutline.Notethat,in additionto theconcatination oftheFontMatrixwiththe transform matricesgenerated
by
thescalefontandmakefontoperators,thefontsare also affectedby
theCurrent Transformation MatrixortheCTM. OthergeneralPOSTSCRIPToperators thatmodifytheCTMarethe
translate,
rotate, and scale operators.So,
thereareseveral waystoscale and rotatefonts. As alreadymentioned,executingthescalefont and makefont operators can scalefonts. Inaddition,thePOSTSCRIPTscaleoperator,whichaffectsthe
CTM,
also applies tofonts. Fontscanberotatedintwoways:by
specifyingthecorrectmatrixvariablesusingthemakefontoperator; or
by
executingthe rotate command. Notethat themakefontoperatorprovidestheuser witha much more powerfultool than
justthescalingandrotatingfunctions. Sincetheuserspecifies amatrix, anylinear
transformationcanbespecified. This is howfontsare obliqued(ie. tilted)for
example.
Thereisone morefuntionthatshouldbementioned:that
is,
applying"intelligence" to theoutlines. Itis commonly knownthatAdobeSystems, Inc.,
theimplementorsofPOSTSCRIPT intheApple LaserWriter
Plus,
appliesproprietary"hints"to theirfontoutlineswhenrenderingthem. This is donetoyieldbetterlooking
charactersatthe300 dotperinchresolutionoftheAppleLaserWriterPlus. Thisprocedureiscertainlydoneatthe0degree
(portrait)
orientation andis probably done atother quadrant orientations- 90degrees(landscape),
180degrees,
and270 degrees. Theperformanceimpactofthisfactor isnotknown.Thissection comparestheperformance ofscalingandrotatinga printerresident
POSTSCRIPT outlinefontversusthesamefontthathas already beenscan
convertedand storedintheRTP's
bit-map
fontcache memory. The fontthathas been selectedfortheseexperimentsistheTimes-Romanfont
twopointsizes willbe 1 1 pointsand22points; threeangles of rotationwillbe
0,
70and90
degrees. 17A^Tcusstdabove,therearetwostepsinrenderingan outlinefont:
-applying thescalingandrotationto thecurrentFontMatrix. This needstobe done for anyscalefactoror rotation angle. Somemultiplies areeasier,
however,
andshould executefaster. Ofthe threeangles specified,0and90 degreesshouldbefasterthan70degrees. _ - scanconvertingthetransformedoutline. In going froman 11 toa22 point
font
twice thenumberofscanlines needtobeaccessed;fourtimesthe numberofpixels needtobewrittento.Scaling
Outline Fonts:Ifc?jtconvertingthetransformedoutlinefontisthedomimant
factor,
the22point fontshouldtake two tofour times longerthan the 1 1pointfont If however applyingthetransformationto thefontoutlineisthedominantfactor,
then the performance shouldbeclosertoequal(i.e.independent ofpoint size). Notknowing
whichoftheseisdominant,
theexpectationrelativetofontsizevariationis asfollows:Asthe, size ofthefontincreases,thetimeneededtorenderthatfontisexpected toincreaseat a ratein betweenoneandthesquareofthesizedifference. Inthe of11and22pointsize
fonts,
the 1 1 pointfontis expectedtoperformfrom 1 to4timesfasterthanthe22pointfont Notethattheeffect ofincorporating
font"intelligence"intothiswas not considered.FontOutline Scan Conversionvs.Pre-Cached
Bit-Map
Fonts:Rendering
anoutlinefont isexpectedto takemuchlongerthanpullingthesamefont
already inbit-map
form,
from die fontcache."Printing
acharacterthatisalready in thefontcacheistypically
athousandtimes fasterthanscanconvertingitfromthe characterdescriptionindiefont"
(reference
12)
Basedonthisinformationit is expectedthat themeasured performance ofpre-cachedfontsshouldbeapproximately 1000 times fasterthanthemeasured performanceofoutlinefonts. Theoverhead ofabase (i.e.
blank)
page mustbeconsideredinthisanalysis. See section3.2.4 formoredetailsonthis experiment.Rotating
OutlineFonts:As fortheeffect ofangleonperformance,it isexpectedthat0 degreeswill yieldthe bestperformancebecauseoftworeasons:
- itis
assumedthat thePOSTSCRIPT interpretor is probablyoptimizedforthis
highly
usedcase;
-at0
degrees,
the cos andsinvalues yield1and0respectively.Assuming
this information isusedtodescreasethenumber ofcalculations,anincreasein performance shouldberealizedTheperformanceofthe90degreerotated case shouldfollowwiththe70 degree rotationcaseyieldingthepoorest performance. Ontheother
hand
the70 degree rotation casecouldinstead, viedthefastestresultsiffontintelligence
stepturnedout tobeadominant(andslow) process.18
Section 2.1.1.4
2. 1.1.5
Variations
ofFontStyle
Onpage20oftheFluent LaserFonts
User's Guide itstatesthat"complex fonts
... willtake
longer
toprintbecauseoftheintricatecurves andshapes". Three printer-residentfontswithdifferent levelsof"complexity"
willbeused:
1.
Helvetica
was chosenfor its
simple style.There
are no serifs andmany
ofthe characters,like
H, A,
andV
usestraightline
segments exclusively.This information
canbe
storedin
avery
compact outlineform
andis
expectedtoscan convertfaster
thanthe two other, more complexfonts described in
2 and3 below.The
text ofthis paragraphis
setin Helvetica
at 12 point.2. Times Romanwaschosenfor itsmediumcomplexitystyle. Ontheonehand Times Roman isa complexfontsinceithasserifsonmanyofthecharacters,
like
"i", "m",
and "T". Ontheotherhand manyoutlinesegments ofthe characters oftheTimes Roman fontare madeupof straightlinesegments orthoganalto thedevicecoordinate system. ThepagethatusestheTimes Roman font isexpectedtoyieldbetterperformancethanthesame pageusing thesimplerHelveticafontshownin(1)
above,butworseperformancethan the morecomplexZapfChanceryMedium Italicfontshowin(3)
below. Thetext ofthisparagraphissetinTimesRomanat12point3.
Zapf
Chancerywas chosenforitscomple^style. 'Whereasthefontsshownin(1)
and(2)
above usedmanystraightOnesegments, theZapf
ChanceryMediumItalic fontusesmanymore curvedsegments,which areinherently
morecompe%. Theperformanceofaprintedpageusing Msfont isexpectedtoyieldtheworst
performancewhen comparedto
(1)
and(2). ThetextofthisparagraphissetinZapf
ChanceryMediumItalicat12point.Notethatwhen "performance"ismentionedabove,onlythescan conversion processis intendedtobeusedas a comparison. Oncethefont is inthe
bitmap
font cache allthreefontsareexpectedtoperformequallywell. Ifthereisa small difference inspeedwhenprinting fromthefontcache,thefontthatisthesmallest (i.e. ZapfChancery)
shouldbethefastest,
withthefontthatis thelargest (i.e.Helvetica)
shouldbetheslowest ThisisbecausethetimetoBitBLTafont characterfromthebitmap
fontcacheisassumedtobedirectiy
proportionalto thesizethatcharacteroccupiesinmemory. Notethatalthough each ofthefontsshown in
(1),
(2)
and(3)
are set at 12points,they
each appeartobeadifferentsize.ExpectedResults
The
following
relativescanconversion rates are expected:- Helvetica:fastest duetothe simple style;
,
- Times Roman:
intermediate;
- Zapf Chancery: slowestduetothecomplexfontstyle.
Oncethefont hasbeenscan converted andplacedintothe
bitmap
fontcache,all fontsare expectedtoprintequally fast.19
2. 1.2. Residentvs.Downloaded Fonts
ProblemDescription
Fontscanbeeither residentintheprinter(i.e.
RIP)
orbe downloaded fromthehost
computer(host-resident).Furthermore,
fontscanbe ineitherbit-map
or outlineformat
Thissection concentrateson observationoftheperformancedifferences betweendownloadable
vs. printer-residentfonts. To simplifythe taskandtoget more meaningfulresultsoutlines are comparedwithoutlines,andbit-maps withbit-maps.Downloading
fontscansignificandy impactsystem performance. Thekey
parameterthateffects performanceiscommunicationtime (i.e. timetodownloadthefont). For
outlinefonts thismaybeabout30 KBytespertypefaceatanysize. For
bit-map
fonts
theamount ofdatavarieswiththesize ofthefont (seesection 1.4). Afullbit-map
representingeach character at each sizeisneededFontscanbe inone ofthe
following
formats:Bit-map
fontsA.
Downloadable
bit-map
fonts;
B.
Printer-resident
bit-map
fonts.AdobeBezieroutlinefonts
C. ResidentintheApple LaserWriterPlusprinter(RIPand printenginecombination);
D.
Host-resident,
downloadable
fonts in AdobeencodedBezierformat
Thirdpartyoudinefonts
E.
Downloadable
fontsinBezier formatdescribed
withgeneric
POSTSCRIPT
instructions;
Allfiveoftheseformatsare usedtoprintsimpletextand arecomparedon aperformance
basisinthis secnon. *
Threecomparisonsare made:
Avs.B Residentvs.
downloaded
bit-map
fonts.Seesections2. 1.2.1 and3.2.1.
C vs.D Residentvs
downloaded Adobe
outlinefonts
Seesections2.1.2.2 and
3.2.2.
Dvs.E Adobevs. thirdparty
downloaded
outlinefonts
Seesections2.1.2.3
and3.2.3.
20
Section2.1.2
2.1.2.1
Downloaded
Bitmapsvs. Printer Resident(Cached)
BitmapsTwo
bitmap
fonts
are usedforthisexperiment: A.Downloadable
bit-map
fontA
hand-coded
POSTSCRIPTbitmap
fontsimilartotheonedescribed insection2.3.3 is downloadedto theAppleLaser WriterPlus. Forthis
experimentonlyten 12-pointcharactersweredefinedat300 dotsperinch. Theseten charactersarethen printed. Thedownload timeaswellasthe printing timesarebothmeasured
B. Printer-resident
bitmap
fontThe Apple LaserWriterPlus hasseveralpre-scanconvertedprinter-resident
bit-map
fonts (reference 14). The 12pointHelveticafont isselectedfor this experiment Thetimetoprintthesametencharacterstringismeasuredand.comparedto thetimetakenwiththedownloadable
bitmap
fontof(A). ExpectedResultsThetotaltimetoprintthedownloadable font includesnotonly printingthe ten characterstring
but,
evenmoresignificantly,alsoincludesthetimetodownloadthebitmap
fontitself. A 12pointfont isassumed at aprinter resolution of300dotsper inch. Ifafullcharacter setwerespecifiedcompletewith upperandlowercaseletters,
then theaverage size of a single characterbitmap
wouldbe approximately170
bytes,
whichis 50%ofthe50pixelby
50pixelcharacterbounding
box (seesection 1.4). Sincethe tencharacterschosenforthisexperiment are alllowercase
lettersit isassumedthat,onaverage,thesize ofthese tencharacterbitmapsare25%
smallerthan theaverage
bitmap
acrosstheentirecharacter set. This bringsthe170 bytesaverageperallcharactersdownto 127bytesaverageperlowercase character.Therefore,
thesizeofthecombinedbitmapsofthe tencharactersis 1,270 bytes.SincePOSTSCRIPTdescribesallbitmapswithASCIIencoded
hex,
thebitmap
dataisexpanded
by
afactoroftwo(i.e. ahexvalueof"A7"is coded astwosequentialASCIIcharacters: "A"and"7". WhenthisistakenintoaccounttheASCIIencoded
bitmaps forthe tenlowercase characterstakeup2,540bytes.
Examining
thePOSTSCRIPT
bitmap
fontshowninsection2.3.3,
itappearsthat thefontoverheadexcludingthefontmetricsis about 1 Kbyte. Themetricsinformationoverheadis about40bytespercharacter or400 bytesperthe tencharacterset Theanticipated
dowloadedfontsizeis:
2,540 bytes: bitmaps fortencharacters
400 bytes:metricinformation fortencharacters + 1.000 bytes: additionalfontoverhead
3,940 bytes:expected sizeoftencharacter
bitmap
fontIftheRS-232serialcommunications interface isused at9600
baud,
then the expecteddownloadtimeforthe3,940bytebitmap
font is 4. 10seconds. ForthisexperimentAppletalkisusedinsteadof
RS-232,
so afaster download time isexpected. Notethat therawdatatransmissionspeed ofAppletalk is 220
Kbits/sec,
althoughtheactualthroughputisafractionofthismainlyduetoprotocol overhead. Seesections2.1.2.4and3.2.4formoreinformationonthistopic.
Oncethe
bitmap
font isdownloadedit isexpectedthat thedownloaded
fontwillperformaswellastheprinter-resident
bitmap
font. Theoveralltimetoprintthedownloadablefontwillbesignificandy longerdueto thefont
download
time.21
2.1.2.2 AdobeDownloadedOutlinesvs.PrinterResident
(Internal)
OutlinesProblem Description , ,. , . . - , .
The AppleLaserWriterPlusprinterhas35resident outlinefonts (seesection2.4for
alistof residentfonts). Inaddition,auser can purchase additionalfonts foruse withMacintoshapplication programs. ThesefontsaresuppliedonMacintosh compatiblemicro-floppy discsandincludeseveral
(usually
four:regular,italic,bold,
andbold italic)
styles of asinglefontfamily. Oneprinteroutlinefontand several(aboutfivedifferentsizes)bitmap
screenfontsisprovided per eachstyle. Thebitmap
screenfontsareusedby
application programstoprovidethedesiredWYSIWYGeffect. Theprinter outlinefontneedstobedownloadedto theprinter beforetheapplication program cansendthePOSTSCRIPTprogramtotheprinter
thatreferencesthatparticularfont Thiscanbedoneeitherexplicitly,witha program whichdownloadstheoutline printer
font
orimplicitly,
by
theapplication programneedingthefont Inthelattercasetheapplicationinterrogatestheprintertodetermine inthefontis already loadedintotheprinter. Ifit
is,
theprint programis simply downloaded. Ifit isnotloaded,
thenthefont isdownloadedright beforethe printprogram.Section 3.2.2compares aparticular printer resident
font
Times-RomantoanotherAdobeoutline
font,
thedownloadable Stone Serif fontThey
arecomparedonthebasisofscanconversion speed,BitBLT fromcachetopagebufferspeed,and downloadtime.
Expected Results
Whetherthefontoriginatesfromthehostor anfromaninternal RIPfont data structure(i.e. in
ROM),
the taskofgeneratingabit-map
fromoutlineis essentiallythesameineithercase,especially if bothfontsweresupplied
by
thesamefont vendorwho,inthiscase, isAdobeSystems,
Inc.So,
the taskofscanconverting theoutlines andthe subsequenttaskofmovingthecachedbitmapsto thepagebuffer inthe twocases are expectedtoyieldsimilarresults.Thefontstyles ofthedownloaded Adobe
font
calledStoneSerif,
waschosentobesimilarin complexityto
Times-Roman,
theinternalfontitisbeing
comparedto.Thiswasdonetominimizetheeffectthatvaryingthecomplexityof afontstylehas on performance. Section2.1.1.5anditscomplement,section
3.1.5
dealwiththis subjectin detail.Theone areawhere alargedifferenceinsystemperformanceisexpectedisinthe
areaoffont download time. Resident fontsareheld inROMsothereisno downloadtime. Downloadedoutlinefontsare
approximately
30to40 KBytesin size. IfanRS-232serialinterfacewereusedrunningat9600baud
thedownload time wouldbeabout35 seconds. Since Appletalk isusedthistimeshouldbeless,
butstill significant22
Section 2.1.2.2
2.1.2.3
Adobe Downloaded Outlines
vs.ThirdParty
DownloadableOutlinesProblemDescription
Asmentionedintheprevious section ausercan purchasedownloadable fontsfor use withMacintoshapplication programs. These fontsaresupplied onMacintosh compatible
micro-floppy
discsandincludeseveral(usually
four:regular,italic,
bold,
andbold italic)
styles of a singlefontfamily. Oneprinter oudinefontand several(about five differentsizes)bitmap
screenfonts isprovidedper eachstyle. Thebitmap
screenfontsare usedby
application programstoprovidethedesiredWYSIWYG
effect. Theprinter outlinefontneeds tobe downloadedto theprinterbeforetheapplicationprogram can sendthePOSTSCRIPTprogramtotheprinter thatreferencesthatparticularfont Thiscanbedoneeitherexpticidy,witha programwhichdownloadsthe outlineprinter
font
orimplicidy,
by
theapplicationprogramneedingthefont Inthelattercasetheapplication programinterrogatesthe printertodetermineifthefont is already loaded intotheprinter. Ifit
is,
theprint programis simply downloaded Ifthefont isnotloaded
thenit isdownloaded right beforetheprint program.Downloadable fontscanbepurchasedfrom
Adobe,
thecreatorsofPOSTSCRIPT andPOSTSCRIPT fonts.They
canalsobepurchasedfromotherthirdparty vendors. Thereare severaldifferences:1. Adobefontsare encrypted
Third party fonts
direcdy
followtheconventionsetinthePOSTSCRIPT LanguageReference Manualwithnoencryption(reference15).2. Adobe fonts have"intelligence". That
is,
thereisaproprietaryAdobealgorithmwhichreadsthe encrypted oudinefontwith"intelligencehints" and scan convertstheoudineproducingahighquality fontatthe300dpiprinter
resolution.
Thirdpartyfontoutlines aretreatedas generic graphic shapeswhenscaled
They
donothave any"intelligence". The qualityproducedona300dpi device isnoticeablypoorerattypical sizes (i.e. 10or12point). Compare figures 3.2.3.A.1 & 2 (nointelligence)
tofigures 3.1.1.A.1 &2 (withintelligence).3. Adobefontsgenerallyoriginatefromwellknownfont houses likeLinotypeand ITCandareaimedatproviding virtuallyallprintingandpublishingneeds.
Thirdpartyfontsgenerallyarenewdesignswithanunconventionalartisticflare.
Note, however,
that thethirdpartyfontselectedforthisexperiment,the CasadyWareGalileoRomanfont
was chosenforitssimilarity (instyle andcomplexity)totheAdobe Stone Seriffont
4. Adobe fonts aretypicallymoreexpensive, costinginthe
$100
to$300.
As anexamplethelistpriceoftheAdobe StoneSeriffontusedinthissection was $275.
Thirdpartyfontsare
typically
lessexpensive,costing inthe$50
range. Asanexamplethelistprice oftheCasadyWare
Galileo
Romanfontusedinthis
sectionwas
$45.
23
Section3.2.3comparesatwodownloaded
fonts,
theAdobeStoneSerifandthe CasadyWare GalileoRomanfont.They
arecompared onthebasisof scan conversionspeed,BitBLT fromcachetopagebufferspeedanddownloadtime.ExpectedResults , ,
ThetaskofscanconvertingtheAdobe
"intelligent"
outlineisinherendymore difficultthanscanconvertinganon-intelligentoutline(i.e.
treating
characterstike graphic shapes). Bothtasksneedtoconverttheoutlines intobitmaps buttheAdobe conversionhasonemorestep,thestepthatincorporatestheintelligence. This impliesthat theAdobe downloaded font (withintelligence)
should scanconvert slowerthantheCasadyWare downloadedfont(without intelligence).Oncethe
bitmap
has beengeneratedfromoutlineandstoredinthefontcachethe task ofprintingthebitmapsisessentiallythe sameineither case.So,
thetaskofmoving diecachedbitmapsto thepagebuffer inthe twocases areexpectedtoyieldsimilar results.BoththeStone SerifandGalileoRomanfontsaredownloadable POSTSCRIPT outlinefonts. It isassumedthat theirsizes aresimilarandsubsequentiytheir download timesshould alsobesimilar.
The fontstylesofthedownloaded Adobe
font
calledStoneSerif,
waschosentobe similarin complexitytoCasadyWareGalileoRomanfontit isbeing
comparedto. Thiswasdonetorninimizetheeffectthatvaryingthecomplexityofafontstylehas on performance. Section2.1.1.5 anditscomplement, section3.1.5 dealwiththis subjectin detail.Probably
thelargest factor istheonethatis leastpredictable. Thatisthevariability introducedwhencomparingtwodifferentfontvendors. Eveniftheoriginaloutlines wereexacdythesame,howtheseoutlinesareconvertedintoaPOSTSCRIPT programmay havesignificant effectsonhowfastthey
scan convert24
Section2.1.2.3
2. 1.2.4
Appletalk
vs. RS-232Comparison
Boththe
Appletalk
andRS-232communicationsinterfaceswereusedthroughoutthispaper. RS-232was used moreextensively duetothegreater controlthis
interface
allows:
-abilitytocapturethereal-time conversationsbetweenthehostcomputerandthe printer with a protocolanalyzer,
-thepredictable overhead(i.e.one startbitand onestop
bit);
-thepointtopoint nature oftheinterface.
Appletalk,
ontheotherhand
was usedprimarilytoallowthedownloadofAdobe andthirdparty(CasadyWare)
downloadable fonts. Sections 2.1.2.1-3 andtheircomplementary
sections3.2.1-3usedAppletalk. Itismoredifficulttoseparateout theprotoco