+
    bIiIk                    @   R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ t^ tRt^ RIHtHtHtHt  ! R R	4      tR
 tR t^ RIHt R tR tR t]3R ltR t ! R R4      t ! R R4      tRRRRRRRRRRR R!R"R#R$R%R&R'R(R)R*R+R,R-R.R//t ! R0 R1]4      t R2 t!RgR4 lt" ! R5 R6]4      t# ! R7 R84      t$ ! R9 R:4      t% ! R; R<]%4      t& ! R= R>]%4      t' ! R? R@]'4      t( ! RA RB]'4      t) ! RC RD]%4      t* ! RE RF4      t+RG t,RgRH lt-RhRI lt. ! RJ RK4      t/]/! 4       t0 ! RL RM]/4      t1 ! RN RO]14      t2 ! RP RQ]14      t3RR t4RSt5RTt6RU t7]1! RV4      t8RiRjRkRlRW]3RX]
3RmRn.]4! RY4      ,           RZ]83.,           ]4! R[4      ,           R\]83RoRW]3RpRX]
3RmRn.,           ]4! R]4      ,           RoRW]3RqRrRmRnRiRs.,           ]4! R^4      ,           RZ]03.,           ]4! R_4      ,           R\]03RtR`RaRuRbRaRtRcRaRvRjRwRoRW]3RxRyRmRn.,           ]4! Rd4      ,           RvRo.,           t9Re t:];Rf8X  d
   ]:! 4        R3# R3# )za!  new experimental paragraph implementation

Intended to allow support for paragraphs in paragraphs, hotlinks,
embedded flowables, and underlining.  The main entry point is the
function

def Paragraph(text, style, bulletText=None, frags=None)

Which is intended to be plug compatible with the "usual" platypus
paragraph except that it supports more functionality.

In this implementation you may embed paragraphs inside paragraphs
to create hierarchically organized documents.

This implementation adds the following paragraph-like tags (which
support the same attributes as paragraphs, for font specification, etc).

- Unnumberred lists (ala html)::

    <ul>
        <li>first one</li>
        <li>second one</li>
    </ul>


Also <ul type="disc"> (default) or <ul type="circle">, <ul type="square">.

- Numberred lists (ala html)::

    <ol>
        <li>first one</li>
        <li>second one</li>
    </ol>

Also <ul type="1"> (default) or <ul type="a">, <ul type="A">.

- Display lists (ala HTML):

For example

<dl bulletFontName="Helvetica-BoldOblique" spaceBefore="10" spaceAfter="10">
<dt>frogs</dt> <dd>Little green slimy things. Delicious with <b>garlic</b></dd>
<dt>kittens</dt> <dd>cute, furry, not edible</dd>
<dt>bunnies</dt> <dd>cute, furry,. Delicious with <b>garlic</b></dd>
</dl>

ALSO the following additional internal paragraph markup tags are supported

<u>underlined text</u>

<a href="http://www.reportlab.com">hyperlinked text</a>
<a href="http://www.reportlab.com" color="blue">hyperlinked text</a>

<link destination="end" >Go to the end (go to document internal destination)</link>
<link destination="start" color="cyan">Go to the beginning</link>

<setLink destination="start" color="magenta">This is the document start
  (define document destination inside paragraph, color is optional)</setLink>

stringWidth)fp_str)Flowablecolors)_baseFontNamegh㈵>)TA_LEFT	TA_CENTERTA_RIGHT
TA_JUSTIFYc                      a  ] tR t^Ut o RR ltRtR tR tRR ltR t	R t
R tR	 tR
 tR tR tR tR tR tRtV tR# )paragraphEngineNc                    ^ RI Hp Vf   . p. V n        Wn        R;V n        V n        RV n        RV n        ^
V n        ^V n	        W n
        R;V n        ;V n        V n        ^ RIHp W0n        . V n        R# )    blackN        	Helvetica)r	   )reportlab.lib.colorsr   lineOpHandlersprogramindentrightIndent
baseindentfontNamefontSizeleading	fontColorxyrisereportlab.lib.enumsr	   	alignmenttextStateStack)selfr   r   r	   s   &&  ڀC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/platypus/para.py__init__paragraphEngine.__init__W   sq    .?G ),,d&#&)))$)/      c                    . pV P                    F  p\        W4      pVP                  V4       K!  	  V P                  V.,           V n        V# N)TEXT_STATE_VARIABLESgetattrappendr$   r%   statevarvals   &   r&   pushTextStateparagraphEngine.pushTextStatem   sK    ,,C$$CLL - #115'9 r)   c                    V P                   R,          pV P                   RR V n         VR,          pV P                   F  pV^ ,          pV^  \        WV4       K  	  R# )   NNNN)r$   r,   setattrr/   s   &   r&   popTextStateparagraphEngine.popTextStatex   s\    ##B'"11#26a ,,C(CaDs# -r)   c                   V P                   P                  4       pVR,          p. pTpV'       d   W@n        ^p	^ p
V'       Ed   V	'       Edy   V P                  pV P                  pW,
          V,
          pV P                   P                  4       pV\
        8  d,   \        RV P                  : RV P                  : RV: 24      h V P                  Wa4      w  pppppppT
T,           p
T P                  pY8  d
   Y,
          pM^ p	T P                   P                  T4       EMT P                  pTTR pT'       g   TR T\        8X  d)   T'       d   \        TT4      pMT P                  T4      pEM(T\        8X  d;   T'       d   \        TT4      pMT P                  T4      pT P                  TTT4      pMT\        8X  d;   T'       d   \        TT4      pMT P                  T4      pT P!                  TTT4      pMT\"        8X  dy   T'       d3   T'       d+   T'       d   \%        TTT4      pMmT P'                  TTT4      pMYT'       d   \        TT4      pMT P                  T4      p\(        '       d   \+        R4       M\        R\-        T4      ,           4      hT'       g   T P/                  T4      pTP1                  T4       EK  V P                   P                  4       pV P                   P                  V4       W(,
          pWvVV3#    h ; i)	zCreturn program with line operations added if at least one line fitsr7   zindents  z too wide for space Nz2no justify because line is not full or end of parazbad alignment r8   )__dict__copyr   r   r   TOOSMALLSPACE
ValueErrorfitLineupdater#   r	   
stringLine
shrinkWrapr
   centerAlignr   
rightAlignr   simpleJustifyAlignjustifyAligndebugprintreprcleanProgramextend)r%   maxwidth	maxheightr   r   
startstate	remainderlineprogramheightremainingroomcursorcountr   r   	linewidthbeforelinestate
lineIsFulllinecursorcurrentLength
usedIndent	maxLengthjustStringsr#   	laststate
heightuseds   &&&&&                    r&   formatparagraphEngine.format   s    ]]'')
AJ	 $7LiDD [[F**K )K7I"mm002O& $++W[WgWgKS"U V V7;||I7X5T6=Y &f,KllG&"1"9$$_5 I "&'*IH '! %dM:D??40DI% %dM:D??40D''mYGH$ %dM:D??40Dt]IFJ& "1$yQ#00}iP")$>#t4uRS !1$y/!ABB((.t$MM&&(	Z(0
	:>>c s   L L	c                6    V P                   P                  4       # r+   )r>   r?   r%   s   &r&   getStateparagraphEngine.getState   s    }}!!##r)   c                <    V P                   P                  V4       R # r+   )r>   rC   )r%   r0   s   &&r&   
resetStateparagraphEngine.resetState   s    U#r)   c                   ^ RI Hp V P                  pW$,
          V P                  ,
          p^ p. p^ p^ p	^ p
\	        V4      p^ p^pRpV P
                  pV P                  pV! RVV4      p^pV'       Egv   W8  Edo   W,          p\        V\        4      '       g   \        VR4      '       Ed	   Tp^ p\        VR4      '       d   ^ pVP                  V 4      p^ pMNTpVP                  4       pV'       d   V! VVV4      pM^ pV'       d   V'       g	   V
'       d   VR,          R8H  pM^ pTpV'       d
   VV,           pV
V,           pVV8  d   V'       g   ^p^p	MZV'       d   VP                  V4       V'       d   VP                  V4       \        V4      \        8  d   VP                  V) 4       Tp
^ pEM\        V\        4      '       dV   ^ p\        V4      pV\        8  d<   V
V,           pVV8  d   V'       g   ^pMV\        8  d   Tp
VP                  V4       ^ pEM\        V\         4      '       Ed   ^ pV^ ,          pVR8X  d    VP                  V4       V^,          p^;rEMkVR8X  d\   V P"                  pVw  pp\        V\        4      '       d   \%        \&        V4      ;pV n        M	T;pV n        VP                  V4       EM	VR8X  d+   Vw  pp T ;qn        V! RVV4      pVP                  V4       EMVR8X  d   Vw  pp!\        \        V!4      4      p"\        V!\        4      '       d]   V!R	,          R
8X  d   V P                  V",           ;pV n        M<V!R	,          R8X  d   V P                  V",
          ;pV n        MT";pV n        M	T";pV n        V! RVV4      pVP                  V4       EM VR8X  d    Vw  pp#V#V n        VP                  V4       EMVR8X  d`   Vw  pp$V P                  V$,           ;p%V n        V'       d&   \+        V%V4      pW$,
          V P                  ,
          pVP                  V4       EMVR8X  d$   V P-                  4        VP                  V4       EMjVR8X  dG    V P/                  4        T P
                  pT P                  pT! RTT4      pTP                  T4       EMVR8X  d   Vw  pp&p%p'p"V%V P0                  ,           p%VV&V%V'V"3pV'       g   \3        R4      h\        V! V&V'V"4      4      p(\        V! RV'V"4      4      pV%V,           V(,           p)\+        V)V4      pV'       d   W$,
          V P                  ,
          pVP                  V4       EMkVR8X  dR   Vw  pp$V P                  V$,           V n        V'       d   W$,
          V P                  ,
          pVP                  V4       EMVR8X  d2   Vw  pp*V P4                  V*,           ;p+V n        VP                  V4       MVR8X  d   Vw  pp,V,V n        VP                  V4       MVR8X  d1   Vw  pp-VP                  V4       V P8                  V-.,           V n        MVR8X  dC   Vw  pp-V P8                  R,          p.V.P;                  V-4       V.V n        VP                  V4       M6\3        R\=        V4      ,           4      h\3        R\=        V4      ,           4      hV'       d   EKr  V^,          pEK~  V'       g   VP                  R4       WWWEV3#    h ; i)z(fit words (and other things) onto a liner   Nr=   widthnextLinecolorfacesizeNr6   N+-r   r   pushpopbulletbullet not at beginning of liner   r!   alignlineOperationendLineOperationr7   z*at format time don't understand indicator z-op must be string, float, instance, or tuple r8   rm   r   )reportlab.pdfbase.pdfmetricsr   r   r   lenr   r   
isinstancestrhasattrrl   stripr.   absr@   floattupler   r-   r   r   maxr3   r:   r   rA   r!   r#   r   removerL   )/r%   r   totalLengthr   r]   r^   donerZ   r[   rY   r\   	maxcursor	needspacefirst
terminatedr   r   
spacewidthr_   opcodelastneedspacerl   
saveopcode	fullwidth	newlengthaopcode
nextLength	indicatoroldcolori	colornamern   fontnamefontsizerp   r   	incrementr   rv   fontbulletwidth	bulletminr!   newriser#   handlerhs/   &&&                                            r&   rB   paragraphEngine.fitLine   sX    	=[[
,t/?/??	
L		
==== h9
$6+_F&%%)@)@ )	6'**"#K"LL.E !I!'J#\\^F +FHh G !!u%/^S%8	$%	!	  %
 2I))3	Y&u
 D!"J %Z1V-5z-/eV-(1 F5))f+=(!.w!6J!)+E "=0,6M KK/EF5))"1I	j( KK'aKF())J '#~~H%+NQ	!)C00181KK1::KK'&$*MQ/77H}!,S(H!EJKK'&$*MQuX/D!(3//#B<,7;}}t7KKHt}%b\3.7;}}t7KKHt}7;;Ht}3774=!,S(H!EJKK'	)#)LQ#*DLKK'(%+NQ	+/;;+BBFT[%(%<
$/$<t?O?O$O	KK'&&&(KK'%))+  $}}H#}}H!,S(H!EJKK'(6<3Qd#doo5Ft<F ()JKK"'FD$(G"HK!&{3d'C!DJ &z 1+ =I!$Y
!;J$/$<t?O?O$O	KK'-%+NQ	'+'7'7	'AD$$/$<t?O?O$O	KK'& &IQ*.))D.8GdiKK''%+NQ	 &/DNKK'/#)LQKK'*.*=*=	*ID' 22#)LQ++A.AHHW%*+D'KK' %%QRVW`Ra%abb !PQUV\Q]!]^^4! KK*&P[\\K s   0\ \c                `    W2,
          pVR ,          pV\         8  d   V P                  W4      # V# )       @r@   insertShift)r%   rZ   
lineLengthr^   diffshifts   &&&&  r&   rF   paragraphEngine.centerAlign  s1    #S##D00r)   c                N    W2,
          pV\         8  d   V P                  W4      # V# r+   r   )r%   rZ   r   r^   r   s   &&&& r&   rG   paragraphEngine.rightAlign  s(    $##D00r)   c                    . p^pV FW  pV'       d<   \        V\        4      '       g   \        VR4      '       d   VP                  V4       ^ pVP                  V4       KY  	  V# )r6   rl   )r~   r   r   r.   )r%   rZ   r   resultr   es   &&&   r&   r   paragraphEngine.insertShift  sU    A*Qs++wq/A/Ae$MM!	 
 r)   c                   W2,
          p^ p^ p^pV Fo  p\        V\        4      '       d   V\        8  d   V'       d   V^,          pK7  V'       g   KA  \        V\        4      '       g   \	        VR4      '       g   Kk  ^p^ pKq  	  V^8  d   V# V\        V4      ,          p	V	\        8:  d   V# ^p^ p. p
^ p\        V4      pW8  d   W,          pV
P                  V4       V'       d,   \        V\        4      '       g   \	        VR4      '       d   ^pM5\        V\        4      '       d    V\        8  d   V'       d   W,           pWR&   V^,          pK  V
# )r   rl   r8   )r~   r   r@   r   r   r}   r.   )r%   rZ   r   r^   r   
spacecountvisibler   r   r   r   r[   nlineexpandeds   &&&&          r&   rI   paragraphEngine.justifyAlign  s   #
A!E""q7a
Jq--71C1C  a<KU:&&-KD	lAMM!*Qs++wq/A/AAe$$=W7%r
aKFr)   c                   . p^ p\        V4      pW48  EdL   W,          p\        V\        4      '       Ed   W4^,
          8  Ed   V.pRpV^,          pW,          pW48  d   \        V\        \        34      '       d   \        V\        4      '       d,   V^ 8  d   V^ 8  d   V) pV^ 8  d   V^ 8  d   V) pWx,          pM'\        V\        4      '       d   VP	                  V4       V^,          pW48  g   K  W,          pK  RP                  V4      p	VP	                  V	4       VP	                  \        V4      4       V^,          pMVP	                  V4       V^,          pEKR  V# )r   r   r=   )r}   r~   r   r   r.   join)
r%   rZ   r   indexmaxindexr   
thestrings	thefloatsnextess
   &&        r&   rE   paragraphEngine.shrinkWrap*  s#   t9nA!C  UA:%5S
	
nE5+)F)F!%..$Q;57)2
I 7y{%*FE!*	#E#.."))%0QJE~ $HHZ(a eI./
a QJEr)   c                   . p^ pV F  p\        V\        4      '       d7   V^ 8  d   V^ 8  d   V) pV^ 8  d   V^ 8  d   V) p\        V4      V,           pKO  \        V4      \        8  d   VP	                  V4       VP	                  V4       ^ pK  	  V'       d   VP	                  V4       ^p\        \        \        V4      ^,
          4      4      pV'       Ed   ^ pV F  pV^,           pW',          p	W(,          p
^ p\        V	\        4      '       g;   \        V
\        4      '       g%   \        V	R4      '       g   \        V
R4      '       d   ^ pMw\        V	\        4      '       db   V	^ ,          p\        V
\        4      '       d$   V
^ ,          p^ pVR8X  d   VR8w  d
   VR8w  d   ^pM\        V
\        4      '       d
   VR8X  d   ^pV'       g   K  WV&   WV&   ^pK  	  EK  V# )zcollapse adjacent spacingsrl   rz   ry   )r~   r   r   r@   r.   listranger}   r   r   r   )r%   rZ   r   lastr   changerliner   	nextindexthisnextdoswapthisindicatornextindicators   &&            r&   rM   paragraphEngine.cleanProgramP  s    A!E""6ac 5DQ346AT{1}t9]*MM$'a   MM$ U3v;q=)*fF!!G	}(d3''d3''4((GD,A,AFU++$(GM!$u--(,Q!")+==-QcBc - >%&F#D//(/9%&F6$(5M(,9%F5 6 r)   c           	        VP                   pVP                  pV P                  P                  4       pRpRpVP	                  V P
                  4       V P                  p	V P                  p
V P                  p^ pV EF  p\        V\        4      '       g   \        VR4      '       Ed   V'       g   \        V
4      \        8  d<   VP                  R\        V
^ 4      ,          4       V ;P                  V
,          un        V P                    F+  pVP#                  V P                  V P$                  WV4       K-  	  ^pWpP&                  8w  g   WP(                  8w  d*   V P&                  pV P(                  pVP+                  Wx4       \        V\        4      '       d   VP-                  V4       EK4  VP/                  WV4       EKI  \        V\0        4      '       dX   \        V4      pV\        8  d?   VP                  R\        V^ 4      ,          4       V ;P                  V,          un        EK  EK  \        V\2        4      '       Ed7   V^ ,          pVR8X  d   Vw  ppV P                  pV P$                  pV P$                  V P4                  ,
          ;pV n        T	;pV n        V P                  p
V P                  p^ pV P                    F  pVP7                  VVWV4       K  	  VP9                  VV4       EK}  VR8X  dg   V P
                  pVw  pp\        V\        4      '       d   \;        \<        V4      ;pV n        M	T;pV n        VV8w  d   VP	                  V4       EK  EK  VR8X  d   Vw  ppVV n        EK   VR8X  d   Vw  pp\        \1        V4      4      p\        V\        4      '       dX   VR,          R	8X  d   V ;P(                  V,          un        M5VR,          R
8X  d   V ;P(                  V,          un        MWn        MWn        V P(                  pVP+                  V P&                  V P(                  4       EK  VR8X  d   Vw  ppVV n        EK  VR8X  d/   Vw  ppV P                  V,           ;pV n        \?        V
V4      p
EK  VR8X  d   V PA                  4        EK-  VR8X  dg   V P
                  pV P&                  pV P(                  p V PC                  4        VV P
                  8w  d   VP	                  V P
                  4       EK  EK  VR8X  d   Vw  pp!VPE                  V!4       EK  VR8X  d   Vw  pp"prx\        V P                  V	,
          4      \        8  d   \G        R4      h\1        \I        V"Wx4      4      p#\1        \I        RWx4      4      p$VV$,           V#,           p%V%V
8  d   T%p
VPK                  V^ 4       VP+                  Wx4       VP-                  V"4       VPK                  V) ^ 4       VP+                  V P&                  V P(                  4       EK  VR8X  d!   Vw  ppV P                  V,           V n        EK  VR8X  d4   Vw  pp&V PL                  V&,           ;p'V n&        VPO                  V'4       EK  VR8X  d   Vw  pp(V(V n(        EK"  VR8X  dJ   Vw  ppVP#                  V P                  V P$                  WV4       V P                   V.,           V n        EKr  VR8X  dp   Vw  ppVP7                  V P                  V P$                  WV4       V P                   R,          ;p)V n        VV)9   d   V P                   PS                  V4       EK  EK  \G        R\U        V4      ,           4      h\G        R\U        V4      ,           4      h	  V P                  P                  4       p*V P                  PW                  V4       V*# )zrender the line(s)Nrl   z%s Tdrm   rn   ro   rp   rq   rr   rs   r   r   rt   ru   wordSpacingrv   rw   r=   r   r!   rx   ry   rz   r7   zdon't understand indicator z!op must be string float or tuple ),_escape_coder>   r?   setFillColorr   r   r   r   r~   r   r   r   r@   r.   r   r   start_atr    r   r   setFonttextOutexecuter   r   r   end_atsetTextOriginr-   r   r   r3   r:   setWordSpacerA   r   
moveCursorr!   setRiser#   r   rL   rC   )+r%   r   canvas
textobjectescapecoderQ   r   rp   xstartthislineindentthislinerightIndentindentedr   r   r   r   endallmarksr   r    newynewxr   r   rn   r   r   r   r   r   r   oldfontoldsizewsrv   r   r   r   r!   r   r#   newhr`   s+   &&&&                                       r&   
runOpCodesparagraphEngine.runOpCodes  sa    ]]'')
 	/"..F&%%'&*A*A>*=8 Gf^Q.G$GH.0#'#6#6((zR $7 &$*===D==D&&t2fS))&&v. NN4V<F5))V-'KK&*; ;<FFf$FF ( F5))"1I	j('-$QAA$(FF4<<$77D46$**D46%)[[N*.*:*:' H#'#6#6q!T:F $7 ,,T48'#~~H%+NQ	!)C00181KK1:: h"//6 '&$*MQ$,DM&$*MQuX/D!(3//#B<, MMT1M%b\3. MMT1M,0M(,#}}H&&t}}dmmD	)#)LQ#*DL(%+NQ	+/;;+BBFT[%(%@N&&&(%#~~H"mmG"mmG%%'  /"//? 0-$GQ++B/(6<3Q466&=)-7()JKK"'FD(G"HK!&{3'C!DJ &z 1+ =I >1)2))&!4&&t2&&v.))6'15&&t}}dmmD-%+NQ	'+'7'7	'AD$& &IQ*.))D.8Gdi&&w/'%+NQ	%.DN/#)LQ$$TVVTVVT:N +/*=*=	*ID' 22#)LQNN4664664L151D1DQ1GGD4.$++227; %%B4	?%RSS !DT&\!QRRq r MM&&(	Z(r)   )r#   r   r   r   r   r   r   r   r   r   r!   r$   r   r    r+   )	r   r   r   r   r   r   r   r!   r#   )r   )__name__
__module____qualname____firstlineno__r'   r,   r3   r:   rb   rf   ri   rB   rF   rG   r   rI   rE   rM   r   __static_attributes____classdictcell____classdict__s   @r&   r   r   U   sb     !")
	
$l?\$$R]h	!~$L?Bk kr)   r   c                    . pV  F,  p\        V\        4      '       g   K  VP                  V4       K.  	  RP                  V4      pV\	        V4      .pRpV '       d    V R,          V8X  d   VP                  V4       V# )zEsimple case: line with just strings and spacings which can be ignoredr=   r{   r8   )r~   r   r.   r   r   )rZ   lengthstringsr   textr   nextlinemarks   &&     r&   rD   rD   >  sn     GaNN1  88GDE&M"F"LR,&|%Mr)   c                t   . pV RR  F,  p\        V\        4      '       g   K  VP                  V4       K.  	  \        V4      ^,
          pW!,
          pRP	                  V4      pV^ 8  d"   V^ 8  d   V\        V4      ,          pRV3WrR.p	MWqR.p	Rp
V '       d    V R,          V
8X  d   V	P                  V
4       V	# )z&simple justification with only stringsNr=   r   r8   )r   r   r{   )r~   r   r.   r}   r   r   )rZ   r\   r^   r   r   nspacesslackr   wordspacingr   r   s   &&&        r&   rH   rH   L  s     G#2YaNN1  'l1nG#E88GDqyU1WE'N* +.AST7"LR,&|%Mr)   r   c                     V P                  4       R9   d   ^# V P                  4       R9   d   ^ # \        RV ,          4      h)Yz+true/false attribute has illegal value '%s')r   YESTRUE1)NNOFALSE0)upperrA   )r   s   &r&   readBoolr  b  s7    zz|00	2	2FMNNr)   c                     V P                  4       pVR 8X  d   \        # VR8X  d   \        # VR9   d   \        # VR8X  d   \        # R# )LEFTRIGHTJUSTIFYN)CENTERCENTRE)r  r	   r   r
   r   )r   ups   & r&   readAlignmentr  j  sF    	B	V|	w	#	#	y 
r)   c           	        V P                  4       p  \        V 4      #   \         d    T P                  4       p T RR	 T R	R r!TP                  4       p \        T4      pM!  \         d    \        RT ,          4      hi ; i R^HRRRRR^/T,          pM!  \         d    \        RT ,          4      hi ; iY4,          u # i ; i)
zERead a dimension measurement: accept "3in", "5cm",
"72 pt" and so on.Nzinvalid length attribute '%s'incmg^|bX<@mmgjZ@pt)r   r   rA   lowerKeyError)r   
numberTextunitsnumber
multipliers   &    r&   
readLengthr  u  s     ::<D#T{ #zz| "Id23iE%%'
	E:&F 	E<tCDD	E	ER]]Q	
 J  	E<tCDD	E ""%#s?   
 4B>AB>A<<B> BB>B00B>=B>c                    V P                  4       p V R,          R8X  d   V RR R8X  d   V ^R p V P                  R4      pV U u. uF  q P                  4       NK  	  pp V U u. uF
  q! V 4      NK  	  pp V# u up i u up i )z0from "(2, 1)" or "2,1" return [2,1], for examplerq   (N),r8   )r   split)r   	convertersls   && r&   lengthSequencer$    sy    		AuczafckaG	
B	 R'')RB	  "	#1)A,B	#I 
!	#s   A5!A:c                   V '       g   R# ^ RI Hp ^ RIHp V ^ ,          V9   d   VP                  V ,          # \        V 4      pRp^\        V4      u;8:  d   ^8:  g   Q V4       h Q V4       hRp\        \        V4      4       F  pW5,          R8:  d   K  Q V4       h	  \        V4      ^8X  d   VP                  pM\        V4      ^8X  d   VP                  pX! V!  # )zCRead color names or tuples, RGB or CMYK, and return a Color object.Nr   )lettersz:Color tuple must have 3 (or 4) elements for RGB (or CMYC).z*Color tuple must have all elements <= 1.0.      ?)
reportlab.libr   stringr&  r>   r$  r}   r   Color	CMYKColor)r   r   r&  tupmsgr   colClasss   &      r&   	readColorr/    s    $Aw't$$

C
FCCA"s""s"
6C3s8_v}!c!}  3x1}<<	SQ##S>r)   c                   ^    ] tR tRt].t].t].t].t].t	]
.t].t].t].t].t].t].tRtR# )StyleAttributeConvertersi   N)r   r   r   r   r  r   r   
leftIndentr   firstLineIndentr  r#   spaceBefore
spaceAfterbulletFontSizebulletIndentr/  	textColor	backColorr   r2  r)   r&   r1  r1    sV    \HLG|JKLOoIK|J<NLkIkIr)   r1  c                   p   a  ] tR tRt o RtRt]t^
t^t	^ t
^ t^ t]t^ t^ t]t^
t^ t]tRtRR ltR tRtV tR# )	SimpleStylei  z6simplified paragraph style without all the fancy stuffbasicNc                    V P                   pV'       d(   VP                   P                  4        F	  w  rVWdV&   K  	  VP                  4        F	  w  rVWdV&   K  	  R # r+   )r>   items)r%   nameparentkwmydictabs   &&&,   r&   r'   SimpleStyle.__init__  sG    ,,.q	 /88:CA1I r)   c                    VP                  4        FR  pW,          pVf   K  \        \        V4      '       d    \        \        V4      ^ ,          pV! V4      p\	        WV4       KT  	  R # r+   )keysr   r1  r-   r9   )r%   
dictionarykeyvaluer"  s   &&   r&   addAttributesSimpleStyle.addAttributes  sT    ??$COE 3S99 '(@# Fq II%e,E5) %r)   r2  r+   )r   r   r   r   __doc__r@  r   r   r   r   r3  r   r4  r	   r#   r5  r6  bulletFontNamer7  r8  r   r9  r:  r'   rL  r   r   r   s   @r&   r<  r<    sb     <DHHGJKOIKJ NNLII* *r)   r<  zh1.defaultStyleHeading1zh2.defaultStyleHeading2zh3.defaultStyleHeading3zh4.defaultStyleHeading4zh5.defaultStyleHeading5zh6.defaultStyleHeading6ztitle.defaultStyleTitlezsubtitle.defaultStyleSubTitlepara.defaultStyleNormalzpre.defaultStyleCodezul.defaultStyleUnorderedListzol.defaultStyleOrderedListli.defaultStyle
Definitionc                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )FastParai  zAparagraph with no special features (not even a single ampersand!)c                P    R V9   d   \        R4      hWn        W n        RV n        R# )&zno ampersands please!N)rA   style
simpletextlines)r%   rc  rd  s   &&&r&   r'   FastPara.__init__  s)     *455
$
r)   c                   V P                   pWn        V P                  pV P                   pVP                  pVP                  pVP
                  pVP                  p	VP                  p
VP                  pVP                  4       p. p^ RI
Hp V! RW4      p. p^ pW,
          V,
          pW,
          V,
          pVV8  d   W,           V,           V3# W(8  d   W3# V P                  EfA   ^ p^ p\        V4      p^ pVV8  d   V'       g   TpV'       g   TpVV,          pV! VW4      pV'       d
   VV,           pVV,           pV'       d   VV8  d   V^,          pTpVP                  V4       Kt  VP                  RP                  V4      V\        V4      34       . p^ pVV,           pVV,           V8  g   K  ^pK  V'       d>   V'       g6   VP                  RP                  V4      V\        V4      34       VV,           pWn        VV n        RP                  VVR 4      ;pV n        MRpV P                   pV P                  pV'       d   WV,           3pV# VV3pV# )r   r   r=   N)rd  availableWidthrc  r   r3  r   r   r   r4  r!  r|   r   re  r}   r.   r   heightrR   )r%   rh  availableHeightrd  rc  r   r   r3  r   r   rp   firstindentwordsre  r   r   currentlinecurrentlengthfirstmaxlength	maxlengthra   r[   nwordsr   thismaxlengththiswordthiswordsize
nextlengthrR   r   s   &&&                           r&   wrapFastPara.wrap  s:   __
,

''%%
--~~~~++  "< d1
'5C"0:=	Z*;6HH"",,::JFZFD- )$2M =*8T@ #/
#:L*\9
$
9(<aKF$.M&&x0 LL388K#8-[IY"Z\"$K$%M!+G!3J!')/9 Tsxx4mSEUWX'/
J$DK),%.)AAI IJJJE$g&=>F  %j1Fr)   c                    V P                   pVP                  pW$8  d   . # V P                  pVf   \        R4      hV P                  pV'       d   \        W64      pW.# V .# )Nzmust wrap before split)rc  r   re  rA   rR   r`  )r%   rh  rj  rc  r   re  rR   r   s   &&&     r&   r!  FastPara.splitF  s^    

--"I

=566NN	E-D;6Mr)   c                j   V P                   pV P                  pVP                  pVP                  pVP                  pVP
                  pVP                  pVP                  pVP                  p	V P                  p
V
P                  pV P                  pV
P                  ^ W,
          4       V
P                  4       pVP                  pVP                  Wg4       VP                   '       d   VP#                  VP                   4       ^p^ pV P$                  V,
          p^ p\'        V4      pVV8  d   VV,          w  pppV^,          pTpV'       d   T	pV\(        8X  d   TpMV\*        8X  d   VV,
          pVVR,          ,           pMqV\,        8X  d   VV,
          pVV,           pMSV\.        8X  dI   TpVV8  d/   V^8  d(   VP1                  VV,
          VR,
          ,          4       MVP1                  R4       VP3                  XV4       VP5                  V4       VV,
          pK  V
P7                  V4       R# )r   r   r'  r   N)rc  re  r   r3  r   r   r   r#   r4  canvr   ri  	translate	beginTextr   r   r9  r   rh  r}   r	   r
   r   r   r   r   r   drawText)r%   rc  re  r   r3  r   r   rp   r#   rk  cr   ri  r   r   r   r    
basicWidthcountnlinesr   r   rq  
thisindentr   extras   &                         r&   drawFastPara.drawU  s   



''%%
--~~~~OO	++II  	
Av{#[[]
4&???##EOO4((;6
UFl%*5\"T66QJE#J(
'!I%"V+s*H$"V+&J&<F1H++Z->,LM++C0$$Qq)t$'	A	

:r)   c                .    V P                   P                  # r+   )rc  r5  re   s   &r&   getSpaceBeforeFastPara.getSpaceBefore  s     zz%%%r)   c                .    V P                   P                  # r+   )rc  r6  re   s   &r&   getSpaceAfterFastPara.getSpaceAfter  s    zz$$$r)   )rh  ri  re  rR   rd  rc  N)r   r   r   r   rN  r'   rv  r!  r  r  r  r   r   r   s   @r&   r`  r`    s.     GFP5n&
% %r)   r`  c                  r    / p ^ RI Hp V! 4       p\        P                  4        F  w  r4W$,          W&   K  	  V # r   )getSampleStyleSheetreportlab.lib.stylesr  DEFAULT_ALIASESr?  )r   r  stylesstylenamekeystylenamevalues        r&   defaultContextr    s9    F8 "F(7(=(=(?$%5 )@Mr)   Nc                 V   / p^ RI Hp V e_   \        P                  4        F  w  r4W09   g   K  W,          W&   K  	  \        P                  4        F  w  r4W@9   g   K  W,          W&   K  	  V! 4       p\        P                  4        F  w  r4W19  g   K  WE9   g   K  WT,          W&   K!  	  V# r  r  )
stylesheetr   r  r  r  r  s   &     r&   buildContextr    s    F8,;,A,A,C(L)'1'?$ -D -<,A,A,C(L+'1'A$ -D !"F(7(=(=(?$%.*B#)#9F  )@ Mr)   c                     a  ] tR tRt o ^ t^ tR'R ltR tR tR t	R t
R tR(R	 ltR)R
 ltR tR*R ltR tR tR tR tR tR tR+R ltR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R,R% lt(R&t)V t*R# )-Parai  Nc                @   W`n         \        V4      V n        W n        W0n        Wn        . V n        . V n        R V n        W@n	        V'       g#   VP                  V n
        VP                  V n        ^ V n        ^ V n        VP                  V n        VP                   V n        R # r+   )r   r  context
parsedText
bulletTextstyle1r   formattedProgramrR   r0   r5  r6  bolditalicr   ro   r   rp   )r%   rc  r  r  r0   r  r   s   &&&&&&&r&   r'   Para.__init__  s    $#G,$$ "
$00D#..DO 	NN	NN	r)   c                    V P                   # r+   )r5  re   s   &r&   r  Para.getSpaceBefore  s     r)   c                    V P                   # r+   )r6  re   s   &r&   r  Para.getSpaceAfter  s    r)   c                $   \         '       dC   \        R \        V 4      W4       \        RV P                  4       \        RV P                  4       W n        \        4       ;V n        pV P                  Vn        V P                  pV P                  pV P                  pV'       d   VR,          pMV P                  P                  pV P                  p^V n        V'       d*   VP                  V4       ^ Vn        ^ Vn        VR,          p	MV P                  P                  p	W)8:  d   ^ V n        V^,           V3# Vf   Vf   \#        R4      hV'       g   V P%                  V4      ;V n        pV P                  '       g/   VP'                  WW4      w  rZrWPn        Wn        Wn        Wn        MV P(                  pRp
V
'       df   V^,           p\/        V P                  RRXV P0                  R7      V n        WP2                  n        V P4                  V P2                  n        ^ V n        MRV n        TpW8  d
   VR,
          pW3p\         '       dG   Vw  pp\7        VV,
          4      R8  d   \        R\9        VV4      ,           4       \        R	W3V4       V# )
WRAPPINGz   r   Nzneed parsedText for formattingr  r  r0   r  g?g?zexact match???zwrap is)rJ   rK   idr  r   rj  r   myenginer   r  r0   r  r   cansplitri   r   r    rA   compileProgramrb   ri  r`   remainderProgramr  r  rR   r6  r   rL   )r%   rh  rj  pr  r  r0   r   r   needatleastrR   r`   ra   ri  r   wr   s   &&&              r&   rv  	Para.wrap  s/   5*bhH%../%&.+--__
00

I&Gkk))G,,LLACAC	*K++--K'DM $A%~66'/=>>%)%8%8%DDDL7$$$&'hh~PW&a$$4!$K&N$-!JI
 %q(F "$++$4(14<<IDN%.NN"(,DNN%DO!DNF%(, !)5FQ?1$%c)&oq)AAB)n>Gr)   c                    V^ 8:  g   V P                   '       g   . # W n        V P                  pVf   \        R4      hV'       g   . # V P                  pV'       d   W.pV# V .pV# )r   zmust call wrap before split)r  rj  r  rA   rR   )r%   rh  rj  r  rR   r   s   &&&   r&   r!  
Para.split  sp     AT]]] I.00#:;;!INN	%F  FFr)   c                   V P                   pV P                  pVf   \        R4      hV P                  pV P                  pV'       d    VP                  V4       ^ Vn        ^ Vn        V P                  pV P                  pV'       d   VR,          pMV P                  P                  pVP                  ^ W`P                  ,
          4       VP                  4       p\        '       g   \         '       d,   \#        RR4       V F  p	\#        V	4       K  	  \#        R4       VP%                  W%V4      pVP'                  V4       R # )Nzmust call wrap before drawr   znow running programz,============================================z,--------------------------------------------)r  r  rA   r0   r`   ri   r   r    r{  ri  r  r   r|  rp   r}  DUMPPROGRAMrJ   rK   r   r~  )
r%   r  r  r0   r`   r  ri  r   tr   s
   &         r&   r  	Para.draw6  s    MM00#9::

NN	LLACACII I&Gkk))G 	
Avii'(KKM;%%&/0%a &&MLL!1a8		

1r)   c                   V P                   pVf   . pTP                  pVP                  pV! RV34       ^ RIHp V! V4      w  V n        V n        V n        V! RVP                  34       VP                  V n	        V! RVP                  34       V! RVP                  34       VP                  '       d   V! RVP                  34       V! RVP                  34       V! RVP                  34       VP                  '       d   V! RVP                  34       V P                   '       d   V P#                  V P                   V4       V P%                  W4       VP                  '       d^   ^ pV F6  pV^,          p\'        V\(        4      '       g   \+        VR	4      '       g   K6   M	  VP-                  VRVP                  ) 34       V# )
Nro   )ps2ttrp   rx   r   r   r   rn   rl   )r  r.   r   reportlab.lib.fontsr  ro   r  r  r   rp   r#   r3  r4  r   r   r9  r  	do_bulletcompileComponentr~   r   r   insert)	r%   r  r   rc  rD  fnr  r  r   s	   &&&      r&   r  Para.compileProgramW  sy    ?GNN^^	FB=-.3Bi+DIt{	FENN$&NN		GU__&(	He&&(*   %//13	M5,,.0	Iu}}%'???)+???NN4??G4j2   E
a$$'(:(:  NNEHu/D/D.D#FH. r)   c                x   Vf   V P                   pV P                  pVf   . pVP                  R4       VP                  '       d0   VP                  RVP                  VP                  ,           34       MVP                  RVP                  34       VP                  R4       V P                  W!R7      pVP                  R4       VP                  R4       VP                  '       d   VP                  RVP                  34       MVP                  R4       VP                  R4       VP                  R4       R # )Nr   r   rt   r{   ru   )r   r   )r  r  r.   r5  r   r  r6  )r%   r   r  rc  s   &&& r&   	linearizePara.linearize  s     J?G	#NNY(9(9%--(GHJNNY68)%%j%B"	#NNY(8(89;NNN,)"r)   c                >   \        V\        4      '       dD   V'       d:   VP                  4       pV'       g   VP                  R 4       R# \	        WV4       R# R# \        V\
        4      '       d   V F  pV P                  WB4       K  	  R# \        V\        4      '       d   Vw  rVrxV'       g   / pRV,           p	\        W	R4      p
V
e   V
! WgW4       R# \        '       d   RV,           .pVP                  pV'       g   / pVP                  4        F  w  rV! R V: RV: 24       K  	  V'       d*   V! R4       V! \        V4      4       V! RV,          4       MV! R4       RP                  V4      p\	        WV4       R# \        R	\        V4      ,           4      hR# )
r=   compile_N<=>z</%s>z/> zdon't know how to handle tag )r~   r   r   r.   handleSpecialCharactersr   r  r   r-   rJ   r?  r   rA   rL   )r%   r  r   stextr   tagnameattdictcontentr  compilernamecompilerLrD  kvr  s   &&&             r&   r  Para.compileComponent  sH   j%% "((*NN3'+DgF  
4((%%a1  
5))1;.Ww%g-Lt48H#5: 5-)AA"bG 'a*+ !0##g,'G+,$
A+DW=$%DtG}%TUU3 *r)   c                    V P                   pV P                  pV P                  pWVV3pVf   TpVf   TpVf   TpY n         W0n        W@n        ^ RIHp	 V	! W#V4      p
V	! WVV4      pW8w  d   VP                  RV
34       V# )Ntt2psro   )ro   r  r  r  r  r.   )r%   r   ro   r  r  oldfaceoldbold	olditalicoldfontinfor  r   r   s   &&&&&       r&   	shiftfontPara.shiftfont  s    ))))KK	3<<>I6		-Tv&	2=NNVTO-r)   c                :    V F  pV P                  WT4       K  	  R # r+   )r  r%   r  r  r  r   r   s   &&&&& r&   r  Para.compile_  s    A!!!- r)   c                8    VP                  \        4       4       R # r+   )r.   PageNumberObjectr%   r  r  r  r   s   &&&&&r&   compile_pageNumberPara.compile_pageNumber  s    ')*r)   c                    V P                  V^R7      w  rVpV F  pV P                  W4       K  	  V P                  WFR7       R# )r6   )r  Nr  r  	r%   r  r  r  r   frE  r   r   s	   &&&&&    r&   	compile_bPara.compile_b  s>    ..q.1QA!!!- w'r)   c                    V P                  V^R7      w  rVpV F  pV P                  W4       K  	  V P                  WGR7       R# )r6   )r  Nr  r  s	   &&&&&    r&   	compile_iPara.compile_i  s>    ...3QA!!!- w)r)   c                    VP                  R \        34       V F  pV P                  WT4       K  	  VP                  R\        34       R# )ry   rz   N)r.   	UNDERLINEr  r  s   &&&&& r&   	compile_uPara.compile_u  s?     	)46A!!!- +Y79r)   c                *   V P                   pVR ,          ;V n         pVR,          pVP                  RV34       WPn         VP                  RV) 34       V F  pV P                  W4       K  	  VP                  RV34       VP                  RV34       R# gffffff?g      ?rp   r!   Nrp   r.   r  	r%   r  r  r  r   rp   newsizer!   r   s	   &&&&&    r&   compile_subPara.compile_sub  s    yy"Sj(	GCx)+	$)A!!!- ((r)   c                   VP                  4       p\        WVV P                  4      pV F  p\        V\        4      '       d$   VP                  4       '       d   \        R 4      hK<  \        V\        4      '       g   KT  Vw  rYrVR8w  d   \        R\        V4      ,          4      hVP                  4       pV	'       d   VP                  V	4       VP                  V4       V P                  WW44       K  	  R# )(don't expect CDATA between list elementslizdon't expect %s inside listN)r?   bulletMakerr  r~   r   r   rA   r   rL   rC   
makeBulletcompile_para)r%   r  r  r  r   r  attsbulletmakerr   attdict1content1newattss   &&&&&&      r&   
compile_ulPara.compile_ul  s     ||~!'>A!C  7799$%OPP Ae$$784HD=$%BT']%RSS))+NN8,&&w/!!'UD r)   c                *    V P                  WW4R R7      # )ol)r  )r
  r  s   &&&&&r&   
compile_olPara.compile_ol#  s    wNNr)   c                R   VP                  4       pVP                  4       p\        R WPP                  4      p\        V4      pRpV'       Ed8   V^ ,          p	V^  \	        V	\
        4      '       d-   V	P                  4       '       d   \        R4      hV'       g   MKW  \	        V	\        4      '       g   Ko  V	w  rrV
R8w  d#   V
R8w  d   \        R\        V
4      ,          4      hV
R8X  dB   V'       d   \        R\        V4      ,           4      hV'       d   V P                  WW44       K  K  V
R8X  g   K  VP                  4       pV'       d   VP                  V4       VP                  WR7       V P                  WW44       RpEK@  V'       d   \        R\        V4      ,           4      hR	# )
dlr  r   dddtz5don't expect %s here inside list, expect 'dd' or 'dt'z2dt will not be displayed unless followed by a dd: )blz0dt will not be displayed unless followed by a ddN)r?   r  r  r   r~   r   r   rA   r   rL   r  rC   r  )r%   r  r  r  r   r  r  contentcopyrv   r   r  r  r  r	  s   &&&&&         r&   
compile_dlPara.compile_dl&  s_    ||~ ||~!$ll;7mkAAA!C  7799$%OPP$Ae$$784HD=Wd]$%\w-&( ) )D=()]^bci^j)jkk))(eM   d]"iikGx0**7*>%%gHFOPTU[P\\]] r)   c                *   V P                   pVR ,          ;V n         pVR,          pVP                  RV34       VP                  RV34       V F  pV P                  W4       K  	  VP                  RV34       WPn         VP                  RV) 34       R# r  r  r  s	   &&&&&    r&   compile_superPara.compile_superQ  s    yy"Sj(	GCx)+(A!!!- (	$)r)   c                   VP                  R4       RV9   dA   TR,          p^ RIHp  V! WPP                  V P                  4      pTP                  RT34       RV9   d   VR,          pVP                  RV34       RV9   d   VR,          p	VP                  RV	34       V F  p
V P                  W4       K  	  VP                  R4       R#    Tp L; i)rt   ro   r  rn   rp   Nr  r  )r.   r  r  r  r  r  )r%   r  r  r  r   ro   r  r   r   rp   r   s   &&&&&      r&   compile_fontPara.compile_font^  s    	#W6?D1T))DKK8 NNVTO-g(INNWi02W6?DNNVTN,A!!!- "s   C Cc                   VR ,          pVP                  RR4      p\        V4      pVP                  R4       VP                  RV34       VP                  RV34       VP                  R\        34       V F  pV P	                  W4       K  	  VP                  R\        34       VP                  RV34       VP                  R4       R# )hrefrn   bluery   rz   Nr  r  )getHotLinkr.   r  r  )	r%   r  r  r  r   urlr   Linkr   s	   &&&&&    r&   	compile_aPara.compile_at  s    foKK0	s|	#),.$/1)46A!!!- +Y79+T24"r)   c                   VR ,          pVP                  RR4      p\        V4      pVP                  R4       V'       d   VP                  RV34       VP                  RV34       VP                  R\        34       V F  pV P	                  W4       K  	  VP                  R\        34       VP                  RV34       VP                  R4       R# )destinationrn   Nry   rz   r  r  )r!  InternalLinkr.   r  r  	r%   r  r  r  r   destr   r$  r   s	   &&&&&    r&   compile_linkPara.compile_link  s    }%KK.	D!	#NNWi02$/1)46A!!!- +Y79+T24"r)   c                   VR ,          pVP                  RR4      p\        V4      pVP                  R4       V'       d   VP                  RV34       VP                  RV34       V'       d   VP                  R\        34       V F  pV P	                  W4       K  	  V'       d   VP                  R\        34       VP                  RV34       VP                  R4       R# )r(  rn   r   ry   rz   Nr  r  )r!  DefDestinationr.   r  r  r*  s	   &&&&&    r&   compile_setLinkPara.compile_setLink  s    }%KK0	d#	#NNWi02$/1NN_i8:A!!!- NN/;=+T24"r)   c                    \        V4      ^8w  g   \        V^ ,          \        4      '       g   \        R4      hV^ ,          pV P	                  WT4       R# )r6   z*content for bullet must be a single stringN)r}   r~   r   rA   r  )r%   r  r  r  r   r   s   &&&&& r&   compile_bulletPara.compile_bullet  s>    w<?*WQZ"<"<IJJqzt%r)   c                    V P                   pVP                  V P                  ,           pVP                  pVP                  pVP                  R WWV34       R# )rv   N)r  r8  r   rO  r7  r.   )r%   r   r   rc  r   r   rp   s   &&&    r&   r  Para.do_bullet  sH    ##doo5####4<>r)   c                    V P                  VR R7      w  rVpV F  pV P                  W4       K  	  V P                  WER7       R# )Courier)ro   Nr  r  s	   &&&&&    r&   
compile_ttPara.compile_tt  s>    ..y.9QA!!!- w'r)   c                0    V P                  R R/W#V4       R# )ro   symbolN)r  r  s   &&&&&r&   compile_greekPara.compile_greek  s    68,ggFr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   EvalStringObjectr  r  s   &&&&&r&   compile_evalStringPara.compile_evalString      (5,,OQr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   
NameObjectr  r  s   &&&&&r&   compile_namePara.compile_name  s    
7ULLIKr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   GetNameObjectr  r  s   &&&&&r&   compile_getNamePara.compile_getName  s    g||LNr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   	SeqObjectr  r  s   &&&&&r&   compile_seqPara.compile_seq  s    	'E<<HJr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   SeqResetObjectr  r  s   &&&&&r&   compile_seqResetPara.compile_seqReset  s    wMOr)   c                P    VP                  \        WW0P                  4      4       R # r+   )r.   SeqDefaultObjectr  r  s   &&&&&r&   compile_seqDefaultPara.compile_seqDefault  rC  r)   c                   Vf   / pV P                   pVP                  RV4      pWe,          p\        RVR7      pVP                  V4       VP                  RR 4      p	V P                  p
\        WWiR7      pV P                  pV
P                  V P                  ,           ;V n        Vn        VP                  VR7       VP                  R4       Wn        R # )Nrc  zrml2pdf internal embedded styler@  rA  r  r  r  r  r{   )
r  r!  r<  rL  r  r  r   r3  r  r.   )r%   r  r  r  r   	stylenamer  rc  newstyler  mystyletheparamybaseindents   &&&&&&       r&   r  Para.compile_para  s    ?G,,KK3	"$EeTw'[[t4
++x'Q /6/A/ADOO/SS','*)&r)   )rj  r   r  r  r  r  ro   r  ri  r  r`   r  r  r   rR   r  rp   r6  r5  r0   r  )NNNNr   r+   )NNNNN)ul)rX  )+r   r   r   r   r5  r6  r'   r  r  rv  r!  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r%  r,  r0  r3  r  r9  r=  rA  rF  rJ  rN  rR  rV  r  r   r   r   s   @r&   r  r    s     KJ#. 
FP0B8t#2'VR$.+(*:)E(O)^V*#,## #,&?(GRLOKPR' 'r)   r  c                   0   a  ] tR tRt o R tRR ltRtV tR# )r  i  c                &   Wn         R pVP                  RV4      ;V n        pRRRRRR/V,          pVP                  RV4      ;V n        pR	V9  d3   Y4,          p^ R
IHp VP                  pV! RRV4      p	\        V	4      VR	&   ^ V n        ^V n	        R# )r]  rc  rb  discr  r  r  Ntyper3  r   XXXr8  )
r  r!  rc  typr|   r   r   r   r  _first)
r%   r  r  r  rc  rh  thestyler   rp   r   s
   &&&&      r&   r'   bulletMaker.__init__  s    !!XXgu55
UVT3d3G<--#t#~H@$$D 	48F!$VD
r)   Nc                   V P                   '       g   R VR&   M^ V n         V P                  pV P                  pVEfg   VR8X  db   VR8X  d   \        ^m4      pMAVR8X  d   \        ^l4      pM.VR8X  d   \        ^n4      pM\	        R\        V4      ,          4      hRV9  d   R	VR&   MVR
8X  d   RV9   d   \        VR,          4      V n        MV ;P                  ^,          un        VR8X  d   \        V P                  4      pMVR8X  d0   \        R4      V P                  ,           ^,
          p\        V4      pMlVR8X  d0   \        R4      V P                  ,           ^,
          p\        V4      pM6\	        R\        V4      ,          4      h\	        R\        V4      ,           4      hRV9  d   W!R&   RV9  d   V P                  VR&   R# R# )r  r5  Nrb  re  circlesquarez&unordered list type %s not implementedrO  ZapfDingbatsr  rK  r  rD  Az&ordered bullet type %s not implementedzbad tagname r  rc  )ri  rh  r  chrrA   rL   intr  r   ordrc  )r%   r  r  rh  r  theords   &&&   r&   r  bulletMaker.makeBullet  su   {{{"%DDKhh,,:};SX(]SB(]SB$%MPTUXPY%YZZ#4/-;D)*$d?!$T']!3DJJJ!OJ8#djj/R#X Xdjj02FVB#X Xdjj02FVB$%MPTUXPY%YZZ W!=>>t#!#$ JJDM r)   )ri  r  rc  r  rh  r+   )r   r   r   r   r'   r  r   r   r   s   @r&   r  r    s     &$' $'r)   r  c                   @   a  ] tR tRt o RtRtR tR tR tR t	Rt
V tR	# )
r@  i   z)this will only work if rml2pdf is present
evalStringc                J    V'       g   / pWn         W n        W@n        W0n        R # r+   )r  r  r  r  )r%   r  r  r  r  s   &&&&&r&   r'   EvalStringObject.__init__%  s    G
r)   c                V    ^ RI Hp VP                  WP                  / 4      ;q@n        V# )r   )
Controller)rlextra.rml2pdf.rml2pdfr{  processTupler  op)r%   r   enginer{  r~  s   &&&  r&   getOpEvalStringObject.getOp-  s%    6!..ullBGGW	r)   c                    ^ RI Hp V P                  pV'       g   . pV P                  V P                  W0P
                  3pV P                  WA4      ;qPn        \        V4      pV! WaP                  VP                  4      # r   r   )r|   r   r  r  r  r  r  r~  r   r   r   )r%   r  r   r  r   r~  r   s   &&     r&   rl   EvalStringObject.width3  sa    <,,Gt||WjjAzz%00W G1oov??r)   c                N    VP                  \        V P                  4      4       R # r+   )r   r   r~  r%   r  r   r   s   &&&&r&   r   EvalStringObject.execute@  s    3tww<(r)   )r  r  r  r  r~  N)r   r   r   r   rN  r  r'   r  rl   r   r   r   r   s   @r&   r@  r@     s'     /G@) )r)   r@  c                   &   a  ] tR tRt o R tRtV tR# )rM  iC  c                    ^ RI Hp V! 4       pV P                  pRV9   d   VR,          pWd,          ;qpn        V# RV9   d   VR,          pMRpVP	                  V4      ;qpn        V# )r   getSequencertemplater  N)reportlab.lib.sequencerr  r  r~  nextf)	r%   r   r  r  globalsequencerattrtemplr~  r  s	   &&&      r&   r  SeqObject.getOpE  sj    8&.|| $E 22BIT\dBB&,,R00W	r)   r~  Nr   r   r   r   r  r   r   r   s   @r&   rM  rM  C  s      r)   rM  c                   *   a  ] tR tRt o RtR tRtV tR# )rE  iV  r@  c                    R # r+   r2  r  s   &&&&r&   r   NameObject.executeX  s    r)   r2  N)r   r   r   r   r  r   r   r   r   s   @r&   rE  rE  V  s     G r)   rE  c                   &   a  ] tR tRt o R tRtV tR# )rU  i[  c                    ^ RI Hp V! 4       pV P                  p VR,          pVP	                  V4       RV n        R#   \         d    Rp L)i ; i)r   r  r  Nr  )r  r  r  r  setDefaultCounterr~  )r%   r   r  r  r  r  defaults   &&&    r&   r  SeqDefaultObject.getOp]  sS    8&.||	4jG 	))'2	  	G	s   	> AAr  Nr  r   s   @r&   rU  rU  [  s     
 
r)   rU  c                   &   a  ] tR tRt o R tRtV tR# )rQ  ii  c                    ^ RI Hp V! 4       pV P                  p VR,          p \	        VR,          4      pTP                  Yg4       RT n        R#   \         d    Rp L<i ; i   ^ p L3; i)r   r  r  Nbaser  )r  r  r  r  rr  resetr~  )r%   r   r  r  r  r  r  r  s   &&&     r&   r  SeqResetObject.getOpk  sq    8&.||	dB	tF|$D 	b'  	B		Ds   	A A$ A! A!$A*r  Nr  r   s   @r&   rQ  rQ  i  s      r)   rQ  c                       ] tR tRtRtRtR# )rI  i{  getNamer2  N)r   r   r   r   r  r   r2  r)   r&   rI  rI  {  s    Gr)   rI  c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )r  i~  c                    Wn         R # r+   example)r%   r  s   &&r&   r'   PageNumberObject.__init__  s    r)   c                ^    ^ RI Hp V! V P                  VP                  VP                  4      # r  )r|   r   r  r   r   )r%   r  r   s   && r&   rl   PageNumberObject.width  s     <4<<&//JJr)   c                Z    VP                  4       pVP                  \        V4      4       R # r+   )getPageNumberr   r   )r%   r  r   r   ns   &&&& r&   r   PageNumberObject.execute  s"      "3q6"r)   r  N)rg  )	r   r   r   r   r'   rl   r   r   r   r   s   @r&   r  r  ~  s     K# #r)   r  c                     ^ RI Hp Hp  ! R RV 4      s\        4       s ! R RV 4      s\        4       pW!R&   W!R&   W!R&   \        VR	&   \        VR
&   \        VR&   \        VR&   \        VR&   R# )z8make the para the default para implementation in rml2pdf)MapNoder{  c                   &   a  ] tR tRt o R tRtV tR# )
paraMapperi  c                n   Vw  rVrxVR ,           p	VP                  RV	4      p	W9,          p
\        RV
R7      pVP                  V4       VP                  RR4      pRpV'       gB   \        V4      ^8X  d2   V^ ,          p\	        V\
        4      '       d   RV9  d   \        W4      pVf   \        WW<R7      pV# )z.defaultStylerc  zrml2pdf internal stylerY  r  Nrb  rZ  )r!  r<  rL  r}   r~   r   r`  r  )r%   	nodetuple
controllerr  	overridesr  r  r  r  r[  rc  r]  r  r   r   s   &&&&&          r&   r|  paraMapper.translate  s    1:.Ww/IGY7I&E!'?NG!!'* \48JF#g,/qzd3''CtO%g4F~gWMr)   r2  Nr   r   r   r   r|  r   r   r   s   @r&   r  r    s     	 	r)   r  c                   &   a  ] tR tRt o R tRtV tR# )ulMapperi  c                <    R / V.R3p\         P                  WRW44      # )paraN)theParaMapperr|  )r%   r  r  r  r  r^  s   &&&&& r&   r|  ulMapper.translate  s%    rI;5G **7SSr)   r2  Nr  r   s   @r&   r  r    s     	T 	Tr)   r  rb  r  r  r  h1h2h3titleN)r|  r  r{  r  r  r  )r  r{  theListMappers      r&   EmbedInRml2pdfr    s{    ;W ( LMT7 T JM$t$t$t&Jv$Jt$Jt$Jt'Jwr)   c                    ^ RI Hp ^ RIHp RRRRRR/pVR	,          V9   d   VP	                  R
4        Tf   . pTP                  R4      p	^p
T	R,          pT	 EF  pT
'       Eg3   TP                  R4      pT^ 8  Ed   TRT pT^ ,          R8X  dd    T^,          R8X  d   \        TR,          ^4      pM\        TR,          4      p T^ 8  d   \        T4      Y^,           R ,           pMRT,           pMY9   dC   Y^,          p\        T\        4      '       d   TP                  R4      pTY^,           R ,           pM[Y9   dC   Y>,          p\        T\        4      '       d   TP                  R4      pTY^,           R ,           pMRT,           pM	RT,           pTP                  4       pTRR  F  pTP	                  TR
,           4       K  	  T'       dg   T'       d_   TR,          T9   d!   TP	                  TR,          R
,           4       M0TR,          P                  4       pT'       d   TP	                  T4       ^ p
EK  	  T#   \         d    Rp ELi ; i)r   )greeks)
whitespaceltr  gtr  amprb  :r   r6   Nr=   N;#r   :   NN:r6   NNutf8r8   )reportlab.platypus.paraparserr  r)  r  r.   r!  r   rN   findrr  rA   rq  r~   bytesdecode)r  r   r   r  r  standardr   r   r   amptextr   lastfragfragmentsemir@  r  r   	sfragmentr  s   &&&                r&   r  r    s   4!3S%,HCyJs 	 jjoGEr{Hu==%DAv7C<7c> #DHb 1A #DHA !t#&q6(67*;#;#&x<% A!(511HHV, q&'!22H^A!(511HHV, q&'!22H  #8|H x<NN$	3BANN1S5!   |z)	"c 13 }**,NND*a d NM & s   !I5IIIc                    RV 9  d   RV 9  d   \        WR7      # ^ RIHp VP                  V RR7      p\	        WVRVR7      # )z]Paragraph(text, style, bulletText=None)
intended to be like a platypus Paragraph but better.
rb  r  )rd  	rparsexmlNentityReplacerr  )r`  r(  r  parsexmlSimpler  )r   rc  r  fragsr  r  
parsedparas   &&&&&  r&   	Paragraphr    sH    
 $3d?// 	,--d$-G
EZt]deer)   c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )UnderLineHandleri  Nc                    Wn         R # r+   )rn   )r%   rn   s   &&r&   r'   UnderLineHandler.__init__  s    
r)   c                    Wn         W n        R # r+   )xStartyStart)r%   r   r    r  r   r   s   &&&&&&r&   r   UnderLineHandler.start_at  s    r)   c                D   VP                   R ,          pVP                  4        V P                  pV P                  f   VP                  pVP	                  V4       VP                  V P                  V P                  V,
          WV,
          4       VP                  4        R# )g       @N)	r   	saveStatern   r   setStrokeColorrZ   r  r  restoreState)r%   r   r    r  r   r   offsetrn   s   &&&&&&  r&   r   UnderLineHandler.end_at  ss    s"

::NNEe$DKKV!3Qx@r)   )rn   r  r  r+   )	r   r   r   r   r'   r   r   r   r   r   s   @r&   r  r    s      r)   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )r"  i#  c                    Wn         R # r+   r#  )r%   r#  s   &&r&   r'   HotLink.__init__%  s    r)   c                    VP                   pV P                  V P                  WV,           .p\        '       d   \	        R V4       V P                  Wt4       R# )zLINKING RECTANGLEN)r   r  r  rJ   rK   link)r%   r   r    r  r   r   r   rects   &&&&&&  r&   r   HotLink.end_at(  s?    ==T[[!hJ75%t,		$r)   c                B    VP                  V P                  V^R7       R# )r6   )relativeN)linkURLr#  )r%   r  r   s   &&&r&   r  HotLink.link0  s    txx2r)   r  N)	r   r   r   r   r'   r   r  r   r   r   s   @r&   r"  r"  #  s      3 3r)   r"  c                   &   a  ] tR tRt o R tRtV tR# )r)  i3  c                J    V P                   pR pVP                  WCVRR7       R# )r  z[0 0 0])BorderN)r#  linkRect)r%   r  r   destinationnamecontentss   &&&  r&   r  InternalLink.link5  s"    ((4	Jr)   r2  N)r   r   r   r   r  r   r   r   s   @r&   r)  r)  3  s     K Kr)   r)  c                   *   a  ] tR tRt o ^ tR tRtV tR# )r/  i:  c                    V P                   pV P                  '       g!   Vw  rErgVP                  W4V4       ^V n        R# R# )r6   N)r#  definedbookmarkHorizontal)r%   r  r   r   r   r    x1y1s   &&&     r&   r  DefDestination.link>  s9    ((|||!NQ2%%o"=DL r)   )r  N)r   r   r   r   r  r  r   r   r   s   @r&   r/  r/  :  s     G r)   r/  c                 l    V P                  4       p. pV F  pVP                  VR ,           4       K  	  V# )r=   )r!  r.   )r   r  r   r   s   &   r&   
splitspacer  E  s1    JJLEFae Mr)   a  
This is Text.
<b>This is bold text.</b>
This is Text.
<i>This is italic text.</i>

<ul>
    <li> this is an element at 1
more text and even more text &amp; on and on and so forth
more text and even more text and on &amp; on and so forth
more text and even more text and on and on &amp; so forth
more text and even more text and on and on and so forth
more text and even more text and on and on and so forth --&gt;
more text <tt>monospaced</tt> and back to normal

    <ul>
        <li> this is an element at 2

more text and even more text and on and on and so forth
more text and even more text and on and on and so forth

        <ul>
            <li> this is an element at 3

more text and even more text and on and on and so forth


                <dl bulletFontName="Helvetica-BoldOblique" spaceBefore="10" spaceAfter="10">
                <dt>frogs</dt> <dd>Little green slimy things. Delicious with <b>garlic</b></dd>
                <dt>kittens</dt> <dd>cute, furry, not edible</dd>
                <dt>bunnies</dt> <dd>cute, furry,. Delicious with <b>garlic</b></dd>
                </dl>

more text and even more text and on and on and so forth

            <ul>
                <li> this is an element at  4
more text and even more text and on and on and so forth
                </li>
                <li> this is an element at4
more text and even more text and on and on and so forth
                </li>
            </ul>
more text and even more text and on and on and so forth
more text and even more text and on and on and so forth

            </li>
        </ul>
more text and even more text and on and on and so forth
more text and even more text and on and on and so forth
        </li>
    </ul>
<u><b>UNDERLINED</b> more text and even more text and on and on and so forth
more text and even more text and on and on and so forth</u>

<ol type="a">
    <li value="3">first element of the alpha list

     <ul type="square">
        <li>first element of the square unnumberred list</li>

        <li>second element of the unnumberred list</li>

        <li>third element of the unnumberred list
        third element of the unnumberred list
        third element of the unnumberred list
        third element of the unnumberred list
        third element of the unnumberred list
        third element of the unnumberred list
        third element of the unnumberred list
        </li>

        <li>fourth element of the unnumberred list</li>

      </ul>

    </li>

    <li>second element of the alpha list</li>

    <li>third element of the alpha list
    third element of the unnumberred list &amp;#33; --> &#33;
    third element of the unnumberred list &amp;#8704; --> &#8704;
    third element of the unnumberred list &amp;exist; --> &exist;
    third element of the unnumberred list
    third element of the unnumberred list
    third element of the unnumberred list
    </li>

    <li>fourth element of the alpha list</li>

  </ol>


    </li>
</ul>
u  
<a href="http://www.reportlab.com">goto www.reportlab.com</a>.


<para alignment="justify">
<font color="red" size="15">R</font>ed letter. thisisareallylongword andsoisthis andthisislonger
justified text paragraph example with a pound sign Â£
justified text paragraph example
justified text paragraph example
</para>

<para alignment="center">
<font color="green" size="15">G</font>reen letter.
centered text paragraph example
centered text paragraph example
centered text paragraph example
</para>
<para alignment="right">
<font color="blue" size="15">B</font>lue letter.
right justified text paragraph example
right justified text paragraph example
right justified text paragraph example
</para>
<para alignment="left">
<font color="yellow" size="15">Y</font>ellow letter.
left justified text paragraph example
left justified text paragraph example
left justified text paragraph example
</para>

c           	      ~   ^ RI Hp ^ RIHp ^ RIHp VP                  VRR7      pV! RR4      p\        We4      pVP                  ^V,          ^
V,          4      w  r\        RW34       V P                  4        V P                  ^V,          ^V,          4       V P                  ^ ^ ^V,          ^
V,          ^ ^R7       Wn        V P                  4        VP                  4        V P                  4        V P!                  ^^ ^ 4       V P                  ^ ^ W^ ^R7       V P                  4        V P#                  4        R# )	r   inch)ParagraphStyler  Nr  rY  z
wrapped as)fillstroke)reportlab.lib.unitsr  r  r  r(  r  r  r  rv  rK   r  r|  r  r{  r  r  setStrokeColorRGBshowPage)
r{  testparar  r  r  r  SPr  r   s
   &&        r&   test2r    s    (3'))($)GJx&AQAVVAdFBtG$FQ	,NNNN1T61T6"IIa!D&DqI3FNNFFH1a#IIa!AaI(MMOr)   zhttp://www.reportlab.comrx   ro   z1This is the first segment of the first paragraph.ry   zHOTLINK This is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. rz   zThis is the SECOND!!! segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. z4This is the THIRD!!! segment of the first paragraph.zThis is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. This is the first segment of the first paragraph. zraised ztext zlowered znormal a  And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a And this is the remainder of the paragraph indented further. a a a a a a a a c                     ^ RI H p  ^ RIHp ^ RIHp RpVP                  V4      p\        V\        4       \        V\        4        \        \        ,           \        ,           p/ pV'       d   \        R4       VP                  V^V,          4       VP                  4       pVP                  ^ ^ 4       \        4       pVP                  V4       ^ Vn        ^ Vn        ^V,          p	Rp
VP%                  WV4      w  rrl\&        '       d	   V ! V4       VP)                  WV4      pVP+                  V4       VP-                  4        \        RRVR,          R	VR
,          4       K  VP/                  4        \        V4       R# )r   )pprint)r   r  zparatest0.pdfzNEW PAGEi  zx=r   zy=r    Nz==============================)r  reportlab.pdfgenr   r  r  Canvasr  testparagraphtestparagraph1test_programrK   r|  r}  r   r   ri   r   r    rb   rJ   r   r~  r  save)r  r   r  r  r  rR   r`   r  r  rO   rP   formattedprogramri  s                r&   testr"  	  s!   '(	BbA	!M	!N </,>		*KKaf%AOOAa !ALL#ACACvHI?@xx]f?g<)u(*%5!<IJJqMJJL&$	#inEFFH	"Ir)   __main__r+   ra  r  )r   d   )r      )rv   zvery long bullet2   r8     )rp      )r   r'  r{   )rv   Bullet
   r8     )rv   z"Bullet not quite as long this timer&  r8  r+  )ro   zHelvetica-Oblique)rn   red)r!      )r!   ir  )r   r&  )rv   Or&  r8  r'  )ro   r   )<rN  r|   r   reportlab.lib.rl_accelr   reportlab.platypus.flowablesr   r(  r   r  r   rJ   r  r@   r"   r	   r
   r   r   r   rD   rH   r   r   r  r  r  r$  r/  r1  r<  r  r`  r  r  r  r  r@  rM  rE  rU  rQ  rI  r  r  r  r  r  r  r"  r)  r/  r  r  r  r  testlinkr  r"  r   r2  r)   r&   <module>r2     sx  ;x 5 ) 1   .
 	
 H Hg gR( 'O	#4 !+ , !* !*J zzzzzz'Z}| a%x a%F(s'8 s'j8' 8't!) !)F  &! 
z Z $$ # #*(XJXf   	3 3 K7 K	W 	`D@. -. (Ei(]+ #	 ##VW	X %h/[ !  "t  uu (2#g&:]+ #x& #  $d  e'e( $j)V1 #$	h'8 ##Y '9'< %i0*;> #  $n  o?o@ (3w!w#'#h'6) #!r?0` #  $A	  B	a0B	b E	a2hB ZF r)   