824N/A/*
824N/A * FSBwraps.psw
824N/A *
824N/A * (c) Copyright 1991-1994 Adobe Systems Incorporated.
824N/A * All rights reserved.
824N/A *
824N/A * Permission to use, copy, modify, distribute, and sublicense this software
824N/A * and its documentation for any purpose and without fee is hereby granted,
824N/A * provided that the above copyright notices appear in all copies and that
824N/A * both those copyright notices and this permission notice appear in
824N/A * supporting documentation and that the name of Adobe Systems Incorporated
824N/A * not be used in advertising or publicity pertaining to distribution of the
824N/A * software without specific, written prior permission. No trademark license
824N/A * to use the Adobe trademarks is hereby granted. If the Adobe trademark
824N/A * "Display PostScript"(tm) is used to describe this software, its
824N/A * functionality or for any other purpose, such use shall be limited to a
824N/A * statement that this software works in conjunction with the Display
824N/A * PostScript system. Proper trademark attribution to reflect Adobe's
824N/A * ownership of the trademark shall be given whenever any such reference to
824N/A * the Display PostScript system is made.
824N/A *
824N/A * ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
824N/A * ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
824N/A * ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
824N/A * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
824N/A * NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
824N/A * TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
824N/A * DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
824N/A * NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
824N/A * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
824N/A * PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
824N/A *
824N/A * Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
824N/A * Incorporated which may be registered in certain jurisdictions
824N/A *
824N/A * Author: Adobe Systems Incorporated
824N/A */
824N/A
824N/Adefineps _DPSFClearWindow(DPSContext ctxt)
824N/A 1 setgray
824N/A 0 0 2000 2000 rectfill
824N/Aendps
824N/A
824N/Adefineps _DPSFPreviewString(DPSContext ctxt; char *font; float size;
824N/A char *text; int height | boolean *bogus)
824N/A mark {
824N/A /font size selectfont
824N/A 0 height neg 5 div itransform
824N/A exch pop 5 exch moveto
824N/A 0 setgray
824N/A (text) show
824N/A } stopped bogus cleartomark
824N/Aendps
824N/A
824N/Adefineps _DPSFReclip(DPSContext ctxt)
824N/A initclip
824N/A initviewclip
824N/Aendps
824N/A
824N/Adefineps _DPSFUndefineFont(DPSContext ctxt; char *font; boolean oldServer)
824N/A currentshared true setshared % currentshared
824N/A {/font undefinefont} stopped % currentshared [font] stopped
824N/A {
824N/A false setshared % currentshared font
824N/A {undefinefont} stopped {
824N/A pop
824N/A } if
824N/A } if
824N/A setshared
824N/A oldServer { 2 vmreclaim } if
824N/Aendps
824N/A
824N/Adefineps _DPSFDefineFontEnumFunctions(DPSContext ctxt)
824N/A $Adobe$DPS$Lib$Dict begin
824N/A /GetFontName { % int GetFontName string
824N/A $Adobe$DPS$Lib$Dict /FontDict get begin
824N/A dup maxItems div truncate cvi baseArray exch get
824N/A exch maxItems mod get
824N/A end
824N/A } bind def
824N/A
824N/A % (str) x y SafeBBox left bottom right top
824N/A /SafeBBox {
824N/A 3 copy % (str) x y (str) x y
824N/A newpath
824N/A moveto % (str) x y (str)
824N/A {
824N/A mark exch false charpath flattenpath pathbbox
824N/A } stopped {
824N/A cleartomark
824N/A 3 -1 roll dup length dup % x y (str) len len
824N/A 1 le {
824N/A pop
824N/A % punt; we can't divide it any more
824N/A 0 0 moveto stringwidth pop % x y wx
824N/A dup 2 index add exch 3 index add exch
824N/A } {
824N/A 2 copy % x y (str) len (str) len
824N/A 2 idiv % x y (str) len (str) len/2
824N/A 0 exch % x y (str) len (str) 0 len/2
824N/A getinterval dup % x y (str) len (s1) (s1)
824N/A 5 index 5 index % x y (str) len (s1) (s1) x y
824N/A $Adobe$DPS$Lib$Dict /SafeBBox get exec
824N/A % x y (str) len (s1) l1 b1 r1 t1
824N/A 9 4 roll % l1 b1 r1 t1 x y (str) len (s1)
824N/A stringwidth % ... x y (str) len wx wy
824N/A 5 -1 roll add exch % ... x (str) len y+wy wx
824N/A 5 -1 roll add exch % ... (str) len x+wx y+wy
824N/A 4 2 roll % ... x+wx y+wy (str) len
824N/A dup 2 idiv % ... x+wx y+wy (str) len len/2
824N/A exch 2 div ceiling cvi
824N/A % ... x+wx y+wy (str) len/2 ceil(len/2)
824N/A getinterval % ... x+wx y+wy (s2)
824N/A 3 1 roll % ... (s2) x+wx y+wy
824N/A $Adobe$DPS$Lib$Dict /SafeBBox get exec
824N/A % l1 b1 r1 t1 l2 b2 r2 t2
824N/A 5 -1 roll 2 copy % l1 b1 r1 l2 b2 r2 t2 t1 t2 t1
824N/A gt {pop} {exch pop} ifelse % l1 b1 r1 l2 b2 r2 t
824N/A 7 1 roll % t l1 b1 r1 l2 b2 r2
824N/A 4 -1 roll 2 copy % t l1 b1 l2 b2 r2 r1 r2 r1
824N/A gt {pop} {exch pop} ifelse % t l1 b1 l2 b2 r
824N/A 6 1 roll % r t l1 b1 l2 b2
824N/A 3 -1 roll 2 copy % r t l1 l2 b2 b1 b2 b1
824N/A lt {pop} {exch pop} ifelse % r t l1 l2 b
824N/A 5 1 roll % b r t l1 l2
824N/A 2 copy % b r t l1 l2 l1 l2
824N/A lt {pop} {exch pop} ifelse % b r t l
824N/A 4 1 roll % l b r t
824N/A } ifelse
824N/A } { % mark (str) x y l b r t
824N/A 8 -4 roll pop pop pop pop
824N/A } ifelse
824N/A } bind def
824N/A /DownloadPS {
824N/A $Adobe$DPS$Lib$Dict /downloadSuccess false put
824N/A (%stdin) (r) file
824N/A cvx stopped
824N/A pop % always true
824N/A % Flush until you get the magic line
824N/A {
824N/A {currentfile 256 string readline} stopped
824N/A pop % don't care stopped result
824N/A pop % don't care readline bool result
824N/A(Magic end of data line \)\)\)\)\)\)\)\)\)\) 99#2 2#99 <xyz> // 7gsad,32h4ghNmndFgj2)
824N/A eq
824N/A {exit} if
824N/A } loop
824N/A } bind def
824N/A end
824N/Aendps
824N/A
824N/Adefineps _DPSFEnumFonts(DPSContext ctxt | int *count; int *totalLength)
824N/A $Adobe$DPS$Lib$Dict begin
824N/A /FontDict 5 dict def
824N/A FontDict begin
824N/A /currentItem 0 def
824N/A /maxItems 100 def
824N/A /maxArrays 20 def % This is the max index, not the array size!
824N/A /baseArray maxArrays 1 add array def
824N/A /currentArray 0 def
824N/A baseArray 0 maxItems array put
824N/A end
824N/A
824N/A /AddFontName { % string AddFontName success
824N/A $Adobe$DPS$Lib$Dict /FontDict get begin
824N/A 1 { % provides enclosing loop for exit
824N/A currentItem maxItems eq
824N/A {
824N/A currentArray maxArrays eq {pop false exit} if
824N/A /currentArray currentArray 1 add def
824N/A baseArray currentArray maxItems array put
824N/A /currentItem 0 def
824N/A } if
824N/A dup length string copy
824N/A baseArray currentArray get currentItem 3 -1 roll put
824N/A /currentItem currentItem 1 add def
824N/A true
824N/A } repeat % provides enclosing loop for exit
824N/A end
824N/A } bind def
824N/A
824N/A 3 dict begin
824N/A /$listString 256 string def
824N/A /countFonts 0 def
824N/A /totalLen 0 def
824N/A
824N/A % Enumerate SharedFontDirectory
824N/A SharedFontDirectory { % forall
824N/A pop % /fontname
824N/A $listString cvs % (fontname)
824N/A dup AddFontName % (name) success
824N/A {
824N/A /countFonts countFonts 1 add def
824N/A length 1 add totalLen add /totalLen exch def
824N/A } {
824N/A pop
824N/A } ifelse
824N/A } forall
824N/A
824N/A % Enumerate %font% storage device, if available.
824N/A /filenameforall where { % if
824N/A pop
824N/A (%font%*) { % filenameforall
824N/A % Check if name is something we really believe
824N/A % is a font. Leave either "false" or "(name) true"
824N/A % on stack
824N/A
824N/A % Discard filenames containing "."
824N/A (.) search { % if
824N/A pop pop pop null false
824N/A } { % else
824N/A dup % (%font%name) (%font%name)
824N/A (%font%) anchorsearch { % if
824N/A % (%font%name) (name) (%font%)
824N/A pop exch pop % (name)
824N/A dup AddFontName % (name) success
824N/A } { % else
824N/A pop null false
824N/A } ifelse
824N/A } ifelse
824N/A
824N/A % Stack is either "<something> false" or "(name) true"
824N/A {
824N/A /countFonts countFonts 1 add def
824N/A length 1 add totalLen add /totalLen exch def
824N/A } {
824N/A pop
824N/A } ifelse
824N/A } $listString filenameforall
824N/A } if
824N/A totalLen totalLength countFonts count
824N/A end
824N/A end
824N/A
824N/A $Adobe$DPS$Lib$Dict /AddFontName undef
824N/Aendps
824N/A
824N/Adefineps _DPSFGetAllFontNames(DPSContext ctxt; int fontCount; int arrLen |
824N/A char fontNames[arrLen])
824N/A $Adobe$DPS$Lib$Dict begin
824N/A FontDict begin
824N/A 0 1 fontCount 1 sub {
824N/A GetFontName fontNames
824N/A ( ) fontNames
824N/A } for
824N/A end
824N/A end
824N/Aendps
824N/A
824N/Adefineps _DPSFGetFontInfo(DPSContext ctxt; int fontNum; boolean oldServer |
824N/A char *familyName; char *fullName; char *weight;
824N/A boolean *blendedFont, *undefineIt, *bogus)
824N/A fontNum $Adobe$DPS$Lib$Dict /GetFontName get exec
824N/A
824N/A dup dup % fontname fontname fontname
824N/A SharedFontDirectory exch known % fontname fontname known
824N/A dup undefineIt exch % fontname known fontname
824N/A % (leave fontname and known on stack
824N/A % for the duration of this call
824N/A % even though I don't list them in
824N/A % the comments)
824N/A { % stopped
824N/A findfont dup % fontdir fontdir
824N/A /FontInfo known { % fontdir bool
824N/A /FontInfo get dup dup % fontinfo fontinfo fontinfo
824N/A /FamilyName known { % fontinfo fontinfo bool
824N/A /FamilyName get % fontinfo (familyname)
824N/A } {
824N/A pop ()
824N/A } ifelse
824N/A exch dup dup % (familyname) fontinfo fontinfo fontinfo
824N/A /FullName known { % (familyname) fontinfo fontinfo bool
824N/A /FullName get % (familyname) fontinfo (fullname)
824N/A } {
824N/A pop ()
824N/A } ifelse
824N/A exch dup dup % (familyname) (fullname) fontinfo*3
824N/A /Weight known { % (familyname) (fullname) fontinfo*2 bool
824N/A /Weight get % (familyname) (fullname) fontinfo (weight)
824N/A } {
824N/A pop (Medium)
824N/A } ifelse
824N/A exch % (familyname) (fullname) (weight) fontinfo
824N/A /BlendAxisTypes known % (familyname) (fullname) (weight) blendedFont
824N/A
824N/A dup blendedFont % (familyname) (fullname) (weight) blendedFont
824N/A } {
824N/A pop () () ()
824N/A false false blendedFont
824N/A } ifelse % (familyname) (fullname) (weight) blendedFont
824N/A false bogus
824N/A
824N/A } stopped {
824N/A () () ()
824N/A false false blendedFont
824N/A true bogus
824N/A } if
824N/A
824N/A 4 1 roll % blendedFont (familyname) (fullname) (weight)
824N/A weight fullName familyName
824N/A % fontname known is still on the stack so...
824N/A % fontname known blendedFont
824N/A
824N/A % if blendedFont (the bool on the stack) is true, don't undefine things
824N/A % just yet since we'll be coming back quite soon for more stuff
824N/A
824N/A not and { % undefine font if we just defined
824N/A % it to get this information
824N/A currentshared true setshared
824N/A exch % currentshared fontname
824N/A {undefinefont} stopped % currentshared [fontname] stopped
824N/A {
824N/A false setshared % currentshared fontname
824N/A
824N/A {undefinefont} stopped {
824N/A pop
824N/A } if
824N/A } if
824N/A setshared
824N/A
824N/A oldServer {2 vmreclaim} if
824N/A } {
824N/A pop
824N/A } ifelse
824N/Aendps
824N/A
824N/Adefineps _DPSFFreeFontInfo(DPSContext ctxt)
824N/A $Adobe$DPS$Lib$Dict /FontDict undef
824N/A $Adobe$DPS$Lib$Dict /GetFontName undef
824N/A 1 vmreclaim
824N/Aendps
824N/A
824N/Adefineps _DPSFIsFontResident(DPSContext ctxt; char *name; | boolean *resident)
824N/A SharedFontDirectory /name known {
824N/A true resident
824N/A } {
824N/A /buf (name) length 6 add string def
824N/A buf 0 (%font%) putinterval
824N/A buf 6 (name) putinterval
824N/A buf status dup resident { pop pop pop pop } if
824N/A } ifelse
824N/Aendps
824N/A
824N/Adefineps _DPSFGetBlendedFontInfo(DPSContext ctxt; int fontNum;
824N/A boolean undefineIt; boolean oldServer |
824N/A int *axes; int *designs;
824N/A char axisNames[256];
824N/A float blendPos[64]; int breakCount[4];
824N/A int blendBreak[48]; float blendBreakValue[48];
824N/A boolean *bogus)
824N/A
824N/A fontNum $Adobe$DPS$Lib$Dict /GetFontName get exec
824N/A $Adobe$DPS$Lib$Dict /stringbuf 256 string put
824N/A dup % duplicate fontname; we'll need it later
824N/A
824N/A findfont /FontInfo get dup % fontinfo fontinfo
824N/A /BlendAxisTypes get % fontinfo array
824N/A dup length axes % fontinfo array
824N/A { % Concatenate all the names into axisNames
824N/A $Adobe$DPS$Lib$Dict /stringbuf get cvs
824N/A axisNames
824N/A ( ) axisNames
824N/A } forall
824N/A dup dup % fontinfo fontinfo fontinfo
824N/A /BlendDesignPositions known { % fontinfo fontinfo known
824N/A /BlendDesignPositions get % fontinfo array
824N/A dup length designs % fontinfo array
824N/A { % enumerate the subarrays
824N/A {
824N/A blendPos
824N/A } forall
824N/A } forall
824N/A false
824N/A } {
824N/A pop true
824N/A } ifelse % fontinfo bool
824N/A exch dup % bool fontinfo fontinfo
824N/A /BlendDesignMap known { % bool fontinfo known
824N/A /BlendDesignMap get % bool array
824N/A {
824N/A dup length % bool subarray len
824N/A breakCount % bool subarray len
824N/A {
824N/A aload pop % bool break breakvalue
824N/A blendBreakValue
824N/A blendBreak
824N/A } forall
824N/A } forall
824N/A false
824N/A } {
824N/A pop true
824N/A } ifelse % bool bool
824N/A
824N/A or bogus
824N/A
824N/A undefineIt { % undefine font if we just defined
824N/A % it to get this information
824N/A currentshared true setshared
824N/A exch % currentshared fontname
824N/A {undefinefont} stopped % currentshared [fontname] stopped
824N/A {
824N/A false setshared % currentshared fontname
824N/A
824N/A {undefinefont} stopped {
824N/A pop
824N/A } if
824N/A } if
824N/A setshared
824N/A oldServer { 2 vmreclaim } if
824N/A } {
824N/A pop
824N/A } ifelse
824N/A $Adobe$DPS$Lib$Dict /stringbuf undef
824N/Aendps
824N/A
824N/Adefineps _DPSFShowText(DPSContext ctxt; char *text; char *font; float size;
824N/A int x, y | boolean *bogus)
824N/A mark {
824N/A /font size selectfont
824N/A x y moveto
824N/A (text) show
824N/A } stopped dup bogus cleartomark
824N/Aendps
824N/A
824N/Adefineps _DPSFShowTextAndGetDimensions(DPSContext ctxt;
824N/A char *text; char *font; float size;
824N/A int x, y |
824N/A float *width, *left, *right,
824N/A *top, *bottom)
824N/A mark {
824N/A /font size selectfont
824N/A x y moveto
824N/A (text) show
824N/A (text) stringwidth pop width
824N/A (text) x y $Adobe$DPS$Lib$Dict /SafeBBox get exec
824N/A } stopped {0 0 0 0} if
824N/A top right bottom left
824N/A cleartomark
824N/Aendps
824N/A
824N/Adefineps _DPSFGetTextDimensions(DPSContext ctxt;
824N/A char *text; char *font; float size;
824N/A float x, y |
824N/A float *width, *height,
824N/A *left, *right, *top, *bottom;
824N/A boolean *bogus)
824N/A mark {
824N/A /font size selectfont
824N/A (text) stringwidth height width
824N/A
824N/A (text) x y $Adobe$DPS$Lib$Dict /SafeBBox get exec
824N/A } stopped dup bogus {0 0 0 0} if
824N/A top right bottom left
824N/A cleartomark
824N/Aendps
824N/A
824N/Adefineps _DPSFGetCTM(DPSContext ctx | float ctm[6], invctm[6])
824N/A matrix currentmatrix dup ctm matrix invertmatrix invctm
824N/Aendps
824N/A
824N/Adefineps _DPSFSetUpMM(DPSContext ctxt; char *font, *str; float size;
824N/A int height; float p[n]; int n | boolean *bogus)
824N/A userdict /fontDefined known {
824N/A /tempfont undefinefont
824N/A } if
824N/A mark {
824N/A /tempfont /font findfont p makeblendedfont definefont
824N/A size scalefont setfont
824N/A 0 height neg 5 div itransform
824N/A exch pop 5 exch moveto
824N/A (str) stringwidth pop pop
824N/A /fontDefined true def
824N/A } stopped bogus cleartomark
824N/Aendps
824N/A
824N/Adefineps _DPSFDrawMM(DPSContext ctxt; char *str; int height)
824N/A 0 height neg 5 div itransform
824N/A exch pop 5 exch moveto
824N/A (str) show
824N/Aendps
824N/A
824N/Adefineps _DPSFPrepareToDownload(DPSContext ctxt; boolean makeShared |
824N/A boolean *currShared)
824N/A $Adobe$DPS$Lib$Dict /DownloadPS get
824N/A currentshared currShared makeShared setshared
824N/Aendps
824N/A
824N/Adefineps _DPSFFinishDownload(DPSContext ctxt; boolean shared | boolean *ok)
824N/A shared setshared
824N/A $Adobe$DPS$Lib$Dict /downloadSuccess get ok
824N/Aendps