+
    bIi1                        R t Rt^ RIt^ RIHtHt ^ RIHtHtH	t	 ^ RI
HtHtHtHtHt ^ RIHt ^ RIHtHtHt ^ RIHt ^ R	IHt ^ R
IHt / t]! R4       FZ  t]^ 8  g   ]^8  d   R],          ]]&   K  ]]! R4      ]! R4      ]! R4      39   d   R] ! ]4      ,           ]]&   KO  ] ! ]4      ]]&   K\  	  AR t!Rt" ! R R4      t# ^ RI5 ^ ^ ]PH                  3R lt%R t& ! R R]4      t']PH                  3R lt(]PH                  3R lt)R R lt*]+R8X  d>   ^ RI,t,]-! ],P\                  4      ^8  d   ],P\                  ^,          t/MRt/]*! ]/RR7       R# R# )!z3.3.0z$Render drawing objects in PostscriptN)BytesIOStringIO)getFontstringWidth
unicode2T1)asByteschar2intrawBytesasNative	isUnicode)fp_str)RenderergetStateDeltarenderScaledDrawing)STATE_DEFAULTS)	rl_config)FILL_EVEN_ODD   z\%03o\()c                     \        V 4      p . pVP                  p^ pV  FF  p\        \        V4      ,          pV! V4       V\	        V4      ,          pV^8  g   K<  ^ pV! R4       KH  	  RP                  V4      # )    z\
 )r   append_ESCAPEDICTr   lenjoin)sRaRncs   &    ڄC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/graphics/renderPS.py_escape_and_limitr$      sm    
A
A	
B	A$
1	SVc6AvJ  771:    a?  
/RE { %def
  findfont begin
  currentdict dup length dict begin
 { %forall
   1 index /FID ne { def } { pop pop } ifelse
 } forall
 /FontName exch def dup length 0 ne { %if
   /Encoding Encoding 256 array copy def
   0 exch { %forall
     dup type /nametype eq { %ifelse
       Encoding 2 index 2 index put
       pop 1 add
     }{ %else
       exch pop
     } ifelse
   } forall
 } if pop
  currentdict dup end end
  /FontName get exch definefont pop
} bind def

/WinAnsiEncoding [
  39/quotesingle 96/grave 128/euro 130/quotesinglbase/florin/quotedblbase
  /ellipsis/dagger/daggerdbl/circumflex/perthousand
  /Scaron/guilsinglleft/OE 145/quoteleft/quoteright
  /quotedblleft/quotedblright/bullet/endash/emdash
  /tilde/trademark/scaron/guilsinglright/oe/dotlessi
  159/Ydieresis 164/currency 166/brokenbar 168/dieresis/copyright
  /ordfeminine 172/logicalnot 174/registered/macron/ring
  177/plusminus/twosuperior/threesuperior/acute/mu
  183/periodcentered/cedilla/onesuperior/ordmasculine
  188/onequarter/onehalf/threequarters 192/Agrave/Aacute
  /Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
  /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute
  /Icircumflex/Idieresis/Eth/Ntilde/Ograve/Oacute
  /Ocircumflex/Otilde/Odieresis/multiply/Oslash
  /Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn
  /germandbls/agrave/aacute/acircumflex/atilde/adieresis
  /aring/ae/ccedilla/egrave/eacute/ecircumflex
  /edieresis/igrave/iacute/icircumflex/idieresis
  /eth/ntilde/ograve/oacute/ocircumflex/otilde
  /odieresis/divide/oslash/ugrave/uacute/ucircumflex
  /udieresis/yacute/thorn/ydieresis
] def
c                     a  ] tR t^Zt o R3R ltR tR4R ltR tR tR5R lt	R t
R	 tR4R
 ltR tR t. ^ 3R ltR tR tR tR tR tR5R ltR tR tR6R ltR6R ltR7R ltR8R ltR9R ltR6R ltR:R ltR;R ltR t R t!R<R  lt"R! t#R=R" lt$R4R# lt%R$ t&R% t'R& t(R' t)R( t*R6R) lt+R>R* lt,R+ t-R, t.R- t/R. t0R4R/ lt1R0 t2R4R1 lt3R2t4V t5R# )?PSCanvasc                Z   Vw  V n         V n        . pVP                  V n        VP                  V n        ^ V n        . V n        V P                  P                  V n        RV n	        R;V n
        ;V n        ;V n        ;V n        ;V n        ;V n        ;V n        V n        . V n        V P'                  \(        R,          \(        R,          4       V P+                  \(        R,          4       V P-                  ^4       V P/                  ^ 4       V P1                  ^4       W n        \4        V n        R# )r   
NfontNamefontSizestrokeColor)widthheightr   _xtraState_pushpop_xtraState_popcommentscodecode_append_sep_strokeColor
_fillColor
_lineWidth_font	_fontSize_lineCap	_lineJoin_color
_fontsUsedsetFontr   setStrokeColor
setLineCapsetLineJoinsetLineWidthPostScriptLevelr   	_fillMode)selfsizerD   	xtraStates   &&& r#   __init__PSCanvas.__init__[   s
   "&
DK	(//'mm	99++	 ,0	0 	0DO 	0do 	0J	0	0*.-	0NT[^J/z0JKN=9:!,&r%   c                ^    V P                   '       d   V P                  R V,           4       R# R# )%N)r2   r4   )rF   msgs   &&r#   commentPSCanvas.commentq   s    ===$**3s73=r%   Nc                    V P                   ^8X  d   V P                  WW4V4       R# V P                   ^8X  d   V P                  WW4V4       R# \        RV P                   ,          4      h)   zUnsupported Postscript Level %sN)rD   _drawImageLevel1_drawImageLevel2
ValueError)rF   imagex1y1r-   r.   s   &&&&&&r#   	drawImagePSCanvas.drawImaget   sY    "!!%Bv>!!1$!!%R?>AUAUUVVr%   c                (    V P                  R 4       R# )showpageNr4   rF   s   &r#   clearPSCanvas.clear}   s    $r%   c                   V P                   '       g   R # . pV P                    FO  p\        V4      pVP                  '       d   K"  VP                  R8X  g   K5  VP	                  RV: RV: R24       KQ  	  V'       dN   VP                  ^ \        4       V P                  P                  ^V P                  P                  V4      4       R # R # )NWinAnsiEncodingzWinAnsiEncoding /z /z RE)
r>   r   _dynamicFontencNamer   insertPS_WinAnsiEncodingr3   r5   r   )rF   Cr*   fontObjs   &   r#   _t1_re_encodePSCanvas._t1_re_encode   s    Hh'G'''GOO=N,N8LM ( HHQ)*IIQ		q 12 r%   c                   \        VR 4      '       g   \        VR4      pMTpV P                  R	,          R8w  d   V P                  4        V P                  P	                  ^ RV P
                  V P                  3,          4       V P                  4        VP                  \        V P                  P                  V P                  4      4      4       W!Jd$   TP                  4        ^ RIHp V! VRRR7       R# R# )
writewbr[   z%%!PS-Adobe-3.0 EPSF-3.0
%%%%BoundingBox: 0 0 %d %d
%%%% Initialization:
/m {moveto} bind def
/l {lineto} bind def
/c {curveto} bind def
)markfilenameXPR3EPSF)creatorcodefiletypeN)hasattropenr3   r^   rd   r-   r.   rh   rk   r	   r5   r   closereportlab.lib.utilsrm   )rF   f_frm   s   &&  r#   savePSCanvas.save   s    q!!aBB99R=*$djjl		  zz$++ 	  	
$))..345;HHJ8vv> r%   c                `    V P                  V P                  34       V P                  R 4       R# )gsaveN)r/   _fontCodeLocr4   r]   s   &r#   	saveStatePSCanvas.saveState   s'    d//12!r%   c                V    V P                  R 4       V P                  4       w  V n        R# )grestoreN)r4   r1   r}   r]   s   &r#   restoreStatePSCanvas.restoreState   s$    $!002r%   c                r    T;'       g    V P                   pT;'       g    V P                  p\        WV4      # )zdReturn the logical width of the string if it were drawn
in the current font (defaults to self.font).)r9   r:   r   )rF   r   fontr+   s   &&&&r#   r   PSCanvas.stringWidth   s3     !!tzz--t~~1H--r%   c                h    V P                   V8w  d!   Wn         V P                  R V,          4       R# R# )z%d setlinecapN)r;   r4   rF   vs   &&r#   rA   PSCanvas.setLineCap   s+    ==!M_Q./ r%   c                h    V P                   V8w  d!   Wn         V P                  R V,          4       R# R# )z%d setlinejoinN)r<   r4   r   s   &&r#   rB   PSCanvas.setLineJoin   s,    >>1N-a/0 r%   c                P   Rp\        V\        \        34      '       d    V P                  RV: RV: RV: 24       R# \        V\        \
        34      '       dM   V^ 8  g   Q R4       hRP                  \        \        V4      4      pV P                  RV: RV: RV: 24       R# R# )z7Two notations.  pass two numbers, or an array and phasesetdash[ z] 0 zphase is a length in user spacez] N)	
isinstancefloatintr4   tuplelistr   mapstr)rF   arrayphasepsoperation	textarrays   &&&  r#   setDashPSCanvas.setDash   s      eU3K((ue[IJuTl++A:@@@:S%1IY{KL ,r%   c                4    Wn         V P                  V4       R # N)r6   setColorrF   colors   &&r#   r@   PSCanvas.setStrokeColor   s    !er%   c           	        V P                   V8w  d   Wn         V'       d   \        VR 4      '       dO   V P                  R\        VP                  VP
                  VP                  VP                  4      ,          4       R# V P                  R\        VP                  VP                  VP                  4      ,          4       R# R# R# )cyanz%s setcmykcolorz%s setrgbcolorN)r=   rs   r4   r   r   magentayellowblackredgreenbluer   s   &&r#   r   PSCanvas.setColor   s    ;;K5&))$$%6

EMM[`[g[ginitit9u%uv$$%5uyy%++W\WaWa8b%bc	  r%   c                4    Wn         V P                  V4       R # r   )r7   r   r   s   &&r#   setFillColorPSCanvas.setFillColor   s    er%   c                    Wn         R # r   )rE   r   s   &&r#   setFillModePSCanvas.setFillMode   s    r%   c                f    WP                   8w  d!   Wn         V P                  R V,          4       R# R# )z%s setlinewidthN)r8   r4   )rF   r-   s   &&r#   rC   PSCanvas.setLineWidth   s*    OO##O.67 $r%   c                    V P                   V8w  g   V P                  V8w  d:   \        V P                  4      V n        Wn         W n        V P                  R 4       R# R# )r   N)r9   r:   r   r3   r}   r4   )rF   r   r+   leadings   &&&&r#   r?   PSCanvas.setFont   sF    ::tt~~x7 #DIIDJ%NR 	  8r%   c                    V P                   R 8w  dI   V P                  V P                   4       V P                  \        W4      : R\        W44      : R24       R # R # )Nz m z	 l stroke)r6   r   r4   r   rF   rV   rW   x2y2s   &&&&&r#   linePSCanvas.line   sB    $MM$++,6">6">RS %r%   c                Z     \        V4      #    \        R\        T4      ,          4      h; i)zc
return a copy of string s with special characters in postscript strings
escaped with backslashes.
zcannot escape %s)r$   rT   ascii)rF   r   s   &&r#   _escapePSCanvas._escape   s.    
	<$Q''	</%(:;;s   
 *c                >   V^8X  d   R# \        W4      pV P                  V4      pV^ 8X  d7   V P                  V P                  4       V P	                  V: RV: R24       R# V^ 8H  ;'       g     V^8H  ;'       g    V^8H  ;'       g    V^8H  pV^8H  ;'       g     V^8H  ;'       g    V^8H  ;'       g    V^8H  pV^8  pV'       d   V'       d   V P                  f   Rp	MRp	V P                  V P                  4       V P	                  V: RV: RV	: 24       V P	                  R4       V P
                  e/   V P                  V P
                  4       V P	                  R4       R# R# V P                  V P
                  4       V P	                  V: RV: R	24       R# )
   Nz m (z) show r   zfill z) true charpath gsave z	grestore zstroke z) true charpath stroke )r   r   r   r7   r4   r6   )
rF   xyr   textRenderModexyfillstroke	addToClipops
   &&&&&     r#   _textOutPSCanvas._textOut   sc   1fA[LLO1MM$//*"Q78q __NA$5__9J__n^_N_"aana&7aa>1;LaaP^`aPa"A%	F&doo.2aKL[)  ,d//0  + - MM$++,"QGHr%   c                   TpV P                   pV P                  pV P                  p	V P                  p
\	        V4      '       g    VP                  R 4      p\        WA.VP                  ,           4       F  w  rW8w  dT   \        VP                  P                  4      pV! RV: R\        V4      : R	24       VV	9  d   V	P                  V4       TpV P                  W#W4       W.P!                  VP                  VP"                  4      V4      ,          pK  	  W8w  d0   RV n        V P'                  VP                  P                  V4       R# R#   \         dq   pTP                  R,          w  r\        TP                  R,          TP                  ^,          : RYL^
,
          T : RYLT : RYMT^
,            : 23,           !  hRp?ii ; i)
utf8:      N:Nr   Nr)   z-->z<--Nr   ) findfont  scalefont setfont)r4   r:   r>   r   r   decodeUnicodeDecodeErrorargsr   substitutionFontsr
   facenamer   r   r   r   rc   r9   r?   )rF   rg   r   r   r   r   fcr4   r+   	fontsUsedescapeeijrw   tpsNames   &&&&&&           r#   _issueT1StringPSCanvas._issueT1String  s|   &&>>OO	||wHHV$
 q7+D+D!DEDAu!!&&++.F6RZK[\]*$$V,MM!a/qxx		28<<A F ;DJLL**84  & wffSk(166":QVVTUYYWX[]Y]^_W`abefaghilmnplphq7r6t+tvvws   E G
A+GG
c                   VR9   pVR9   pV'       g
   V'       Ed   VR8w  dw   \        W0P                  V P                  4      p	VR8X  d
   W,          pMFVR8X  d   WR,          ,          pM/VR8X  d)   V\        WSWP                  V P                  4      ,          p\	        V P                  4      p
V P
                  V P                  ,          '       g   \        V
P                  P                  4      pRV: R\        V P                  4      : R2V P
                  V P                  &   WP                  9  d   V P                  P                  V4       V^ 8w  d0   V P                  R	\        W4      : R
\        V4      : R24       ^ ;rV P                  pV
P                  '       d   V P!                  WW6R7       MV P#                  WW#VR7       V P%                  V4       V^ 8w  d   V P                  R4       R# R# R# )r   leftendmiddle       @numericr   r   r   zgsave z translate z rotater   r   N)r   r   r      )rQ   r      r   )r   r9   r:   numericXShiftr   r3   r}   r
   r   r   r   r>   r   r4   r=   rb   r   r   r   )rF   r   r   r   angletext_anchorr   needFill
needStroketextLenrg   r   oldColors   &&&&&&&      r#   
drawStringPSCanvas.drawString+  s   !Y.#y0
zzF"%aDNNC%LA (*OA )+{WZZWWAdjj)G99T..//!',,"3"34U[\bcgcqcq\r-s		$++,0OO**62ax  6!;vV[}!]^	{{H###aAE##Ga.#QMM(#ax  , 1 "r%   c                .    V P                  WW4VR 7       R# )r   r   Nr   )rF   r   r   textr   r   s   &&&&&&r#   drawCentredStringPSCanvas.drawCentredStringI  s    OOAnO]r%   c                .    V P                  WW4VR 7       R# r   r   )rF   r   r   r   r   r   s   &&&&&&r#   drawRightStringPSCanvas.drawRightStringL  s    qXr%   c
           	        R p
\        W4      \        W4WVWx4      3pV P                  R8w  d:   V P                  V P                  4       V P                  W,          R,           4       V P                  R8w  dW   V P                  V P                  4       T P                  W,          T	;'       d    R;'       g    R,           R,           4       R# R# )z%s m %s curvetoNz eofillz
 closepathr   z stroke)r   r7   r   r4   r6   )rF   rV   rW   r   r   x3y3x4y4closedcodelinedatas   &&&&&&&&&&  r#   	drawCurvePSCanvas.drawCurveO  s    $rrrr >???d"MM$//*ho:;$MM$++,ho & 7 7<>>B@'( ) %r%   c                    \        W4      \        W4      r1\        W$4      \        W$4      rBV P                  W3W23W43W33^WVR7       R# )z)Draw a rectangle between x1,y1, and x2,y2)r  r   r   N)minmaxpolygon)rF   rV   rW   r   r   r   r   s   &&&&&&&r#   rectPSCanvas.rect]  sE     RS[BRS[Brgrgrgrg6q]r%   c           	        \        W4      \        W4      r1\        W$4      \        W$4      rBRpR.pVP                  p	V	! WqV,           W&,           WV) ^Z^3,          4       V	! WqV,           WF,
          WV) ^R3,          4       V	! WsV,
          WF,
          WV) RR3,          4       V	! WsV,
          W&,           WV) ^ ^Z3,          4       V	! R4       V P                  V4       R# )zDraw a rounded rectangle between x1,y1, and x2,y2,
with corners inset as ellipses with x radius rx and y radius ry.
These should have x1<x2, y1<y2, rx>0, and ry>0.zJmatrix currentmatrix %s %s translate %s %s scale 0 0 1 %s %s arc setmatrixnewpathi  h  	closepathN)r
  r  r   _fillAndStroke)
rF   rV   rW   r   r   rxryellipsePathrras
   &&&&&&&   r#   	roundRectPSCanvas.roundRecte  s     RS[BRS[B c [II	+Br3C8
89	+Br3S9
9:	+Br3S9
9:	+Br3B7
79	+Br%   c                *    V P                  WW44       R# )ziDraw an orthogonal ellipse inscribed within the rectangle x1,y1,x2,y2.
These should have x1<x2 and y1<y2.N)drawArcr   s   &&&&&r#   ellipsePSCanvas.ellipse  s     	RB"r%   c                ^    V P                  W,
          W#,
          W,           W#,           4       R # r   )r  )rF   xcycrs   &&&&r#   circlePSCanvas.circle  s    RT"$RT*r%   c                *   W,           R,          W$,           R,          rW1,
          R,          WB,
          R,          rV P                  WW4WV4      p\        P                  V,          R,          p\        P                  V,          R,          pW,           p^ pV P                  R8w  d   V P	                  V P                  4       V P                  V4       ^pV P                  R8w  d   V P                  R4       V P                  W4       V P                  R4       V P                  R8w  d   V P                  R4       V P                  R8w  d   V P	                  V P                  4       W\        P                  ! V4      ,          ,           W\        P                  ! V4      ,          ,           ppV'       g   V P                  V4       V'       d5   V P                  W4       V P                  VV4       V P                  R4       V P                  R4       R# R# )	zDraw a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
starting at startAng degrees and covering extent degrees.   Angles
start with 0 to the right (+x) and increase counter-clockwise.
These should have x1<x2 and y1<y2.r   g     f@Nr|   eofillr   r  r   )
_genArcCodemathpir7   r   r4   r6   lineTocossin)rF   rV   rW   r   r   startAngextent
fromcentercxcyr  r  r  startAngleRadiansextentRadiansendAngleRadianscodelineAppendedstartxstartys   &&&&&&&&           r#   r  PSCanvas.drawArc  s    %ruckB%ruckB##BBHE GGH,U2u,+; ??d"MM$//*X&   $&(8(8(AKKX&  $&(8(8(D $MM$++, "dhh/@&A#A A2RcIdFdCdVV#  *B"FF+  -X& %r%   c                    \        W1,
          R,          4      p\        WB,
          R,          4      pW,           R,          W$,           R,          rRpV^ 8  d   RpMRpWWxWUV,           V3pW,          # )zOCalculate the path for an arc inscribed in rectangle defined by (x1,y1),(x2,y2)r   zImatrix currentmatrix %s %s translate %s %s scale 0 0 1 %s %s %s setmatrixarcarcn)abs)rF   rV   rW   r   r   r-  r.  xScaleyScaler   r   r  r:  r  s   &&&&&&&       r#   r'  PSCanvas._genArcCode  sg     beS[!beS[!s{RUCK1^Q;CCVXDr%   c                ,   \        V4      ^8  g   Q R4       hV^ ,          pVR,          p. pVP                  pV! R\        V4      ,          4       V F  pV! R\        V4      ,          4       K  	  V'       d	   V! R4       V P                  WcVR7       R# )r   z"Polygon must have 2 or more pointsrQ   NN%s m%s lr  )r   r   N)r   r   r   r  )	rF   pr  r   r   startpolyr  points	   &&&&&    r#   r  PSCanvas.polygon  s    1v{@@@{!bEKK	&6%=
 !Efve}$% kNDD9r%   c           	         V P                   R 8w  dc   V P                  V P                   4       RpV F=  pV P                  V\        V^ ,          4      \        V^,          4      3,          4       K?  	  R # R # )Nz%s m %s l stroke)r6   	_setColorr4   r   )rF   lineListr   r-   r  r   s   &&&&  r#   linesPSCanvas.lines  s^    $NN4,,-)H   VDG_VDG_,M!MN ! %r%   c                H    V P                  R \        W4      ,          4       R# )rB  Nr4   r   rF   r   r   s   &&&r#   moveToPSCanvas.moveTo      &,./r%   c                H    V P                  R \        W4      ,          4       R# )rC  NrO  rP  s   &&&r#   r*  PSCanvas.lineTo  rS  r%   c                L    V P                  R \        WW4WV4      ,          4       R# )z%s cNrO  )rF   rV   rW   r   r   r   r  s   &&&&&&&r#   curveToPSCanvas.curveTo  s    &rR";;<r%   c                (    V P                  R 4       R# )r  Nr\   r]   s   &r#   	closePathPSCanvas.closePath  s    %r%   c                n   \        V4      ^8  g   Q R4       hV P                  R8w  d   V P                  V P                  4       V P                  V^ ,          ^ ,          V^ ,          ^,          4       VR,           F#  pV P	                  V^ ,          V^,          4       K%  	  V P                  R4       R# R# )rQ   z#Polyline must have 1 or more pointsNrA  r   )r   r6   r   rQ  r*  r4   )rF   rD  r   s   && r#   polyLinePSCanvas.polyLine  s    1v{AAA{$MM$++,KK!Q1a)rUUAaD!A$' X& %r%   c                   . pVP                   p^pV EFN  pV^ ,          p\        VR,          4      pV\        8X  dk   V'       d#   ^ pV! R\        VR,          4      ,          4       MV! R\        VR,          4      ,          4       V! R\        VR,          4      ,          4       K  V\        8X  d+   ^ pVR,          w  rrrV! V P                  WWW4      4       K  V\        8X  dl   V'       d#   ^ pV! R\        VR,          4      ,          4       MV! R\        VR,          4      ,          4       V! R\        VR,          4      ,          4       EK?  \        RV,           4      h	  V'       d	   V! R	4       V P                  V4       R
# )rQ   rA  rB  :Nr   NrC  :r   NN:Nr   Nz
%s curvetozunknown figure operator: r  N)	r   r   
figureLiner   	figureArcr'  figureCurve	TypeErrorr  )rF   partListr  
figureCoder  firstpartr   r   rV   rW   r   r   
startAngler.  s   &&&            r#   
drawFigurePSCanvas.drawFigure  s9   
DaBR>DZEfvd2h//0fvd2h//0&6$r(++,y04R-bJ$""2zAB{"Efvd2h//0fvd2h//0,R!112 ;B >??3 6 kNJ'r%   c                   V P                   ;'       d    TpV P                  ;'       d    TpV'       g   V'       g
   V'       EdC   V P                  P                  V4       V'       d   Vf   V P                  pV'       g	   V'       d   V P                  R4       V P                  V P                   4       T P                  V\        8X  d   RMR4       V'       g	   V'       d   V P                  R4       V'       d_   V'       d   V P                  R4       V P                  V P                  4       V P                  R4       V'       d   V P                  R4       V'       d%   V P                  R4       V P                  R4       R # R # R # )Nr|   r&  r   r   r   clipr  )r7   r6   r3   extendrE   r4   r   r   )rF   r3   rl  r   r   fillModes   &&&&&&r#   r  PSCanvas._fillAndStroke  s
   ''4""--v6TTIIT"##~~HT4#3#3G#<doo.  X}-D&QT4#3#3J#?))'2d//0  *))*5  (  +  "r%   c                H    V P                  R \        W4      ,          4       R# )z%s translateNrO  rP  s   &&&r#   	translatePSCanvas.translate,  s    &+56r%   c                H    V P                  R \        W4      ,          4       R# )z%s scaleNrO  rP  s   &&&r#   scalePSCanvas.scale/  s    fQk12r%   c                L    V P                  R \        WW4WV4      ,          4       R# )z[%s] concatNrO  )rF   r  br"   dr   rw   s   &&&&&&&r#   	transformPSCanvas.transform2  s    A)<<=r%   c                "    WuV n         V n        R# )z1if this is used we're probably in the wrong worldN)r-   r.   )rF   whs   &&&r#   _drawTimeResizePSCanvas._drawTimeResize5  s    "#
DKr%   c                   ^pVP                  R4      pVP                  w  rV'       g   TpV'       g   T	pV P                  P                  RV: RV: R2V: RV: R2RV,          .4       V P                  P                  V: RV	: RV: 2RV: R^ : R^ : RV	) : R^ : RV	: R2R	R
.4       \	        VR4      '       d   VP
                  MVP                  ! 4       p
V P                  V
4      p\        V4      pVP                  ^N4      pVR8w  d%   V P                  V4       VP                  ^N4      pK+  V P                  R4       V P                  R4       R# )   RGBr|   r   
 translate scalez/scanline %d 3 mul string defr   ]z2{ currentfile scanline readhexstring pop } false 3zcolorimage tobytesr   z% end of image datar   N)convertrG   r3   rm  rs   r  tostring_AsciiHexEncoder   readr4   )rF   rU   rV   rW   r-   r.   component_depthmyimageimgwidth	imgheightrawimagehex_encoded	outstreamdatalines   &&&&&&        r#   rR   PSCanvas._drawImageLevel19  s1    --&%llEF& 			!#B'"6*+h6	 	 			"I?%-q!iZIN@	 	 (/wy'A'AGOOwGWGWWZ**84 [)	>>"%"nX&nnR(H./$r%   c                    \        4       p\        V4       F$  pVP                  R\        V4      ,          4       K&  	  VP	                  4       # )zHelper function used by imagesz%02x)r   r   rk   r   getvalue)rF   inputoutputchars   &&  r#   r  PSCanvas._AsciiHexEncodew  s9    ENDLL(4.01 #  r%   c           	        VP                   R8X  d   ^p^pTpM<VP                   R8X  d   VP                  R4      p^pTpMVP                  R4      p^p^pVP                  w  rV'       g   T	pV'       g   T
pV P                  P	                  RV: RV: R2V: RV: R2.4       V^8X  d   V P                  R4       MV^8X  d   V P                  R	4       V P                  R
WX3,          4       V^8X  d   V P                  R4       V^8X  d   V P                  R4       V P                  P	                  RV	: RV
) : RV
: R2RRR.4       \        VR4      '       d   VP                  MVP                  ! 4       pV P                  V4      p\        V4      pVP                  ^N4      pVR8w  d%   V P                  V4       VP                  ^N4      pK+  V P                  R4       V P                  R4       R# )z"At present we're handling only PILL1r  r|   r   r  r  z/DeviceRGB setcolorspacez/DeviceGray setcolorspacezY
<<
/ImageType 1
/Width %d /Height %d  %% dimensions of source image
/BitsPerComponent %dz/Decode [0 1]z6/Decode [0 1 0 1 0 1]  %% decode color values normallyz/ImageMatrix [z 0 0 z 0 r  z./DataSource currentfile /ASCIIHexDecode filterz>> % End image dictionaryrU   r  r   z> % end of image datar   N)moder  rG   r3   rm  r4   rs   r  r  r  r   r  )rF   rU   rV   rW   r-   r.   imBitsPerComponentimNumComponentsr  imwidthimheightr  r  r  r  s   &&&&&&         r#   rS   PSCanvas._drawImageLevel2~  s    ::s?!"OGZZ3mmC(GOGmmE*GO!"#LLEF		!#B'"6*, 	-
 a78!89  #.@A	B 	D a_-aUV		w	S[\L7#% 	&
 (/wy'A'AGOOwGWGWWZ**84 [)	>>"%"nX&nnR(H01$r%   )rD   r=   r7   rE   r9   r}   r:   r>   r;   r<   r8   r5   r6   r1   r/   r3   r4   r2   r.   r-   )),  r  r   )NNr   )r   )r   r   r   )r   r   )r   r   )rQ   rQ   )r  r  )r   r  r   )r   rQ   rQ   )r   rQ   rQ   N)6__name__
__module____qualname____firstlineno__rI   rN   rX   r^   rh   ry   r~   r   r   rA   rB   r   r@   r   r   r   rC   r?   r   r   r   r   r   r   r   r  r  r  r  r#  r  r'  r  rL  rQ  r*  rW  rZ  r]  ri  r  rq  rt  ry  r~  rR   r  rS   __static_attributes____classdictcell____classdict__s   @r#   r'   r'   Z   s    ',4W%
3?,"3.0
1
 a 	Md8
!T
<I854-<^Y
)^ 8#+)'V$: O00=&'"(H,*73>';%|!:% :%r%   r'   )*c                T    \        4       pVP                  \        V 4      WW4R7       R# )z
As it saysshowBoundaryN)_PSRendererdrawr   )drawingcanvasr   r   r  r   s   &&&&& r#   r  r    s!    AFFw'AFQr%   c                    . pVP                   p\        ^ \        V 4      ^4       F   pV! W,          W^,           ,          34       K"  	  V# )zc
given a list of coordinates [x0, y0, x1, y1....]
produce a list of points [(x0,y0), (y1,y0),....]
)r   ranger   )r  Pr  r   s   &   r#   _pointsFromListr    sB    
 	A	A1SVA	14A#- Hr%   c                      a  ] tR tRt o RtR tRRRRRR	R
RRRRRRR/tR tR tR t	R t
R tR tR tR tRR ltR tR tRtV tR# ) r  i  zThis draws onto a EPS document.  It needs to be a class
rather than a function, as some EPS-specific state tracking is
needed outside of the state info in the SVG model.c                N   V P                   P                  RV,          4       V P                   P                  p\        V\        4      '       d   VP
                  '       g   V P                   P                  4        \        V4      pV P                  P                  V4       V P                  V/ 4       V P                  V4       V P                  P                  4       p\        V\        4      '       d   VP
                  '       g   V P                   P                  4        V P                   P                  RV,          4       W P                   n        VP                  4        F?  w  rVWPP                  9   g   K  \!        V P                   V P                  V,          V4       KA  	  R# )z=This is the recursive method called for each node
in the treezbegin node %rzend node %rN)_canvasrN   r=   r   Path
isClipPathr~   r   _trackerpushapplyStateChangesdrawNodeDispatcherr0   r   items	_restoressetattr)rF   noder   deltasrDeltaskr   s   &&     r#   drawNode_PSRenderer.drawNode  s    	_T12##4&&4???LL""$ t$6"vr* 	%--##%4&&4???LL%%']4/0# MMODANN"T^^A%6q9 $r%   r,   r6   strokeWidthr8   strokeLineCapr;   strokeLineJoinr<   	fillColorr7   r*   r9   r+   r:   c                "   VP                   VP                  u;8X  d   ^ 8X  dn   M MjV P                  P                  VP                  VP
                  VP                  VP                  ,           VP
                  VP                  ,           4       R# V P                  P                  VP                  VP
                  VP                  VP                  ,           VP
                  VP                  ,           VP                   VP                  4       R# )r   N)	r  r  r  r  r   r   r-   r.   r  )rF   r  s   &&r#   drawRect_PSRenderer.drawRect  s    77dgg""LLFFDFFFF4::%tvvdkk'9; LL""FFDFFFF4::%tvvdkk'9477DGGr%   c                    V P                   P                  '       dI   V P                   P                  VP                  VP                  VP
                  VP                  4       R # R # r   )r  r6   r   rV   rW   r   r   )rF   r   s   &&r#   drawLine_PSRenderer.drawLine
  s?    <<$$$LLdggtwwA %r%   c                |    V P                   P                  VP                  VP                  VP                  4       R # r   )r  r#  r0  r1  r"  )rF   r#  s   &&r#   
drawCircle_PSRenderer.drawCircle  s$    VYY		688<r%   c           
        VP                  4       w  r#pV^ 8X  g   Vf   V^ 8X  g   Vf   VP                  '       g   VP                  pVP                  pVP                  pVP
                  pVP                  p	We,
          p
V P                  P                  Wy,
          W,
          Wy,           W,           WZ^R7       R# VP                  4       p\        V\        4      '       d   V P                  V4       R# V P                  V4       R# )r   N)r/  )
_xtraRadiiannularstartangledegreesendangledegreescenterxcenteryradiusr  r  	asPolygonr   r  drawPathdrawPolygon)rF   wedgeyradiusradius1yradius1r  r  r  r  r  r.  r  s   &&          r#   	drawWedge_PSRenderer.drawWedge  s    %*%5%5%7"(QJ'/!x?OY^YfYfYf % 7 7#33O]]GmmG\\F$8FLL  '.RYRa!a ! 9 !A!D!!a   #r%   c                    V P                   P                  '       d1   V P                   P                  \        VP                  4      4       R # R # r   )r  r6   r]  r  pointsrF   rD  s   &&r#   drawPolyLine_PSRenderer.drawPolyLine#  s2    <<$$$LL!!/!((";< %r%   c                &   VP                   VP                  ,
          pVP                   VP                  ,           pVP                  VP                  ,
          pVP                  VP                  ,           pV P                  P                  W$W54       R # r   )r0  r  r1  r  r  r  )rF   r  rV   r   rW   r   s   &&    r#   drawEllipse_PSRenderer.drawEllipse'  s^    ZZ'**$ZZ'**$ZZ'**$ZZ'**$R2)r%   c                f    V P                   P                  \        VP                  4      ^R7       R# )rQ   )r  N)r  r  r  r  r  s   &&r#   r  _PSRenderer.drawPolygon/  s"    _QXX6qAr%   c           
     >   \        VR ^ 4      pV P                  P                  '       g	   V'       d   V P                  P	                  4       pVR,          VP
                  VP                  VP                  3w  rErgVR9   g~   VR,          VR,          r\        WxV	4      p
VR8X  d
   WZ,          pMPVR8X  d   WZ^,          ,          pM9VR8X  d   V\        WGWV	RR7      ,          pM\        R	\        V4      ,           4      hV P                  P                  WVWrR
7       R# R# )r   
textAnchorr*   r+   r   r   r   winansi)encodingzbad value for text_anchor r   N)rE  	inherited)getattrr  r7   r  getStater   r   r   r   r   rT   r   r   )rF   	stringObjr   Sr   r   r   r   r   r+   r   s   &&         r#   r   _PSRenderer.drawString2  s     +;A><<"""n&&(A&'oy{{9;;y~~&]#KA"77!":*h%d:%LA (*NA )+{XW`aaA$%A#kBR%RSSLL##A#L '5r%   Nc                  aaaaa ^ RI Ho V P                  oSP                  SP                  SP
                  SP                  3o\        SRR4      pVVV3R lpSf   \        SRSP                  4      oSP                  RJpSP                  RJpSP                  pVV3R lpVV3R lp	V3R	 lp
VR
8X  d   V! 4        V! WeVR7       R# VR8X  dD   V'       d   V! RR7       V! WeVR7       R# V'       g	   V'       d   V! 4        V! V^ VR7       R# R# V'       d   V! RR7      '       d
   V! 4        R# V'       g	   V'       d   V! 4        V! V^ VR7       R# R# )r   )_renderPath	autocloser   c                     < S! SS3/ V B # r    )kwdsr  	drawFuncspaths   ,r#   rP _PSRenderer.drawPath.<locals>.rPI  s    tY7$77r%   Nrn  c                  .   < SP                   ! . 3R S/V B # )rn  r  )r  r"   rn  s   ,r#   <lambda>&_PSRenderer.drawPath.<locals>.<lambda>P  s    Q--bL8LtLr%   c                  ,   < S P                  . ^ SR7      # )r   )r   rn  r  )r"   rn  s   r#   r  r	  Q  s    A,,RH,Mr%   c                  *   < S P                  . ^ R7      # )r   )r   r  )r"   s   r#   r  r	  R  s    a..r.:r%   svg)r   r   rl  pdfT)
forceClose)	countOnly)reportlab.graphics.shapesr  r  rQ  r*  rW  rZ  r  rE   r7   r6   r  )rF   r  rn  r  r  r   r   rl  faspathFill
pathStroker  r"   r  s   &ff        @@@r#   r  _PSRenderer.drawPathD  s
   9LLXXqxxAKK@	DR0		8tJq{{;H||4't+LM:
eDvT2d#6646qd3   T**46qd3  r%   c           
        VP                  4        EF-  w  r4VR8X  dM   V P                  P                  V^ ,          V^,          V^,          V^,          V^,          V^,          4       KY  VR8X  d   V P                  P                  V4       K}  VR8X  d   V P                  P	                  V4       K  VR8X  d   V P                  P                  V4       K  VR8X  d   V P                  P                  V4       K  VR8X  d   V'       d   \        V\        \        34      '       dG   \        V4      ^8X  d7   \        V^,          \        \        34      '       d   V^ ,          pV^,          pM^ pV P                  P                  WE4       EKz  V P                  P                  4        EK  VR8X  d   V P                  P                  V4       EK  VR9   g   EK  VP                  R	V P                  P                  4      pVP                  RV P                  P                  4      pV P                  P!                  Wg4       EK0  	  R
# )zTThis takes a set of states, and outputs the operators
needed to set those propertiesry  r,   r  r  r  strokeDashArrayr  r+   r*   N)r+   r*   )r  r  ry  r@   rC   rA   rB   r   r   r   r   r   r   getr9   r:   r?   )rF   deltanewStatekeyvaluer   fontnamefontsizes   &&&     r#   r  _PSRenderer.applyStateChangesd  s     ++-JCk!&&uQxq58!&q58U1X?% ++E2%))%0'''.((((/))!%e55#e*a-JW\]^W_afgk`lLmLm %a %a !LL((5LL((* # ))%0
 00 !99Z1C1CD 99Z1G1GH$$X8U (r%   c                    ^ RI Hp V! VP                  4      pV P                  P	                  VP
                  VP                  VP                  VP                  VP                  4       R# )r   )ImageReaderN)
rv   r   r  r  rX   _imager   r   r-   r.   )rF   rU   r   ims   &&  r#   rX   _PSRenderer.drawImage  sA    3$ryyU\\Rr%   r   r   )r  r  r  r  __doc__r  r  r  r  r  r  r  r  r  r   r  r  rX   r  r  r  s   @r#   r  r    s|     ::< ~m\/Zd [jQX;(IB=$$=*BM$4@-9^S Sr%   r  c                     \        V 4      p \        V P                  V P                  34      p\	        W^ ^ VR7       VP                  V4       R# )r   r  N)r   r'   r-   r.   r  ry   )rx  fnr  kwdr"   s   &&&, r#   
drawToFiler(    s<    AA!''!((#$Aq!,/FF2Jr%   c                P    \        4       p\        WVR7       VP                  4       # )z=Returns a PS as a string in memory, without touching the diskr  )r   r(  r  )rx  r  r   s   && r#   drawToStringr*    s    	Aq,/::<r%   epsoutc                    ^ RI Hp ^ RIHp VP                  R,          p. ROVP                  R&    ^ RIpVP                  P                  V 4      '       g   VP                  V 4       . p\        V4       FD  pVR,          R8X  g   K  \        W'4      pV! 4       p	\        VRR4      p
VP                  W34       KF  	  ^ pV Fc  w  rWP                  ,           R	V,          ,           p\        W4       V'       g   V^8  d   \        R
\        V4      ,          4       V^,          pKe  	  WBP                  R&   R#   YBP                  R&   i ; i)r   )
testshapes)verbose:NNNN:r   
   N
getDrawingr$  r   zrenderPS_%d.epszrenderPS test saved %s)zTimes-Romanz
Times-BoldzTimes-ItaliczTimes-BoldItalicCourier)reportlab.graphicsr-  reportlab.rl_configr.  _FONTSosr  isdirmkdirdirr  r   sepr(  printr   )outDirshoutr-  r.  OLDFONTSr5  drawingsfuncnamefuncr  	docstringr   rx  filenames   &&            r#   testrC    s   -+  #HdJa(ww}}V$$HHVJH~-z3&#D26	 45 ( &NQ):1)<<Hq"	5)AE(O)S#TFA	 '  (!x!s   AD8 B D8 8E__main__T)r<  )r+  F)0__version__r$  r(  ior   r   reportlab.pdfbase.pdfmetricsr   r   r   rv   r   r   r	   r
   r   reportlab.lib.rl_accelr   reportlab.graphics.renderbaser   r   r   r  r   	reportlabr   reportlab.pdfgen.canvasr   r   r  r"   ordchrr$   re   r'   r  r  r  r  r(  r*  rC  r  sysr   argvoutdirr   r%   r#   <module>rQ     sR   2    I I P P ) V V 4  1	sAtq#v 1A	
s4yS#c(+	+c!fAQA 
  - ^^	% ^	%B1 ( 1G1G R
	AS( ASF #,"8"8  "+!7!7 (: Z
388}Q!d r%   