
    Q?hC                     X   S r SrSrSSKJr  SSKJrJrJrJ	r	  SSK
Jr  SSKJrJrJrJrJrJrJrJrJrJr J!r"J#r$J%r&  \" \SS5      r'\" \SS5      r(\" \SS5      r) " S	 S
5      r* " S S\*5      r+\," \\\\\	S94S jr- " S S\*5      r. " S S\*5      r/\0" 5       r1 " S S5      r2S r3S r4g)z3.3.0a  Classes for ParagraphStyle and similar things.

A style is a collection of attributes, but with some extra features
to allow 'inheritance' from a parent, and to ensure nobody makes
changes after construction.

ParagraphStyle shows all the attributes available for formatting
paragraphs.

getSampleStyleSheet()  returns a stylesheet you can use for initial
development, with a few basic heading and text styles.
)PropertySetParagraphStylestr2alignment	LineStyle	ListStyleStyleSheet1getSampleStyleSheet    )black)TA_LEFT	TA_CENTERTA_RIGHT
TA_JUSTIFY)tt2ps)canvas_basefontnameunderlineWidthunderlineOffsetunderlineGapstrikeWidthstrikeOffset	strikeGapspaceShrinkageplatypus_link_underlinehyphenationLanghyphenationMinWordLengthuriWasteReduceembeddedHyphenation   c                   H    \ rS rSr0 rS
S jrS rS rS rSS jr	S
S jr
S	rg)r   3   Nc                    SU R                   ;  d   S5       eSU R                   ;  d   S5       eU(       aQ  UR                  U R                  :X  d7   SUR                  R                  < SU R                  R                  < 35       eXl        X l        U R
                  R                  U R                   5        U R                  5         U R                  " S0 UD6  g)	zWhen initialized, it copies the class defaults;
then takes a copy of the attributes of the parent
if any.  All the work is done in init - styles
should cost little to use at runtime.namez1Class Defaults may not contain a 'name' attributeparentz3Class Defaults may not contain a 'parent' attributezParent style z# must have same class as new style N )	defaults	__class____name__r!   r"   __dict__updaterefresh_setKwds)selfr!   r"   kws       F/var/www/html/env/lib/python3.13/site-packages/reportlab/lib/styles.py__init__PropertySet.__init__6   s     T]]*_,__*t}},c.cc,##t~~5  dqw  rB  rB  rK  rK  LP  LZ  LZ  Lc  Lc  8d  d5 	T]]+
 	    c                 R    UR                  5        H  u  p#X0R                  U'   M     g N)itemsr'   )r+   r,   keyvalues       r-   r*   PropertySet._setKwdsL   s     ((*JC"']]3 %r0   c                 T    SU R                   R                  < SU R                  < S3$ )N<z 'z'>)r%   r&   r!   r+   s    r-   __repr__PropertySet.__repr__Q   s    "nn55tyyAAr0   c                     U R                   (       aD  U R                   R                  R                  5        H  u  pUS;  d  M  X R                  U'   M     gg)zsre-fetches attributes from the parent on demand;
use if you have been hacking the styles.  This is
used by __init__r!   r"   N)r"   r'   r3   )r+   r4   r5   s      r-   r)   PropertySet.refreshT   sD     ;;"kk2288:
00).MM#& ; r0   c                    [        US-   U R                  5        [        US-   U R                  5        [        U R                  R                  5       5      nUR                  5         UR                  S5        UR                  S5        U H3  nU R                  R                  US 5      n[        X< SU< 3-   5        M5     g )Nzname =zparent =r!   r"   z = )	printr!   r"   listr'   keyssortremoveget)r+   indentkeylistr4   r5   s        r-   	listAttrsPropertySet.listAttrs]   s    fx+fz!4;;/t}}))+,vx CMM%%c40E&U334 r0   c                     U R                  X5      nU R                  R                  5       Ul        Xl        US L =(       a    U =(       d    UUl        UR
                  " S0 UD6  U$ )Nr#   )r%   r'   copyr!   r"   r*   )r+   r!   r"   kwdsrs        r-   clonePropertySet.cloneh   sR    NN4']]'')
T>*d4f	

Tr0   r=   r2   ) )r&   
__module____qualname____firstlineno__r$   r.   r*   r:   r)   rH   rN   __static_attributes__r#   r0   r-   r   r   3   s&    H,(
B/	5r0   r   c            	           \ rS rSr0 S\_SS_SS_SS_S	S_S
S_S\_SS_SS_S\_SS_SS_S\_SS_SS_SS_SS_0 SS_SS_SS_SS_SS_SS_SS_SS_S \_S!S"_S#S_S$S_S%\_S&\	_S'\
_S(\_S)\_E\\SS\\\S*.ErS+rg),r   p   fontNamefontSize
   leading   
leftIndentr	   rightIndentfirstLineIndent	alignmentspaceBefore
spaceAfterbulletFontNamebulletFontSizebulletIndent	textColor	backColorNwordWrapshapingborderWidthborderPaddingborderColorborderRadiusallowWidowsr   allowOrphanstextTransformendDotssplitLongWordsr   bulletAnchorstartjustifyLastLinejustifyBreaksr   r   r   r   r   )r   linkUnderlineunderlineColorstrikeColorr   r   r   r#   )r&   rQ   rR   rS   _baseFontNamer   r
   _baseUnderlineWidth_spaceShrinkage_baseStrikeWidth_baseUnderlineOffset_baseUnderlineGap_baseStrikeOffset_baseStrikeGap_platypus_link_underline_hyphenationLang_embeddedHyphenation_uriWasteReducer$   rT   r#   r0   r-   r   r   p   s   1
=1
21
 	"1
 	Q	1

 	a1
 	!1
 	G1
 	a1
 	Q1
 	1
 	1
 	q1
 	U1
 	D1
  	4!1
( 	1)1
* 	q+1
, 	-1
. 	t/1
0 	11
2 	q31
4 	51
6 	71
8 	$91
> 	?1
@ 	-A1
B 	C1
D 	1E1
F 	G1
H 	/I1
J 	'K1
L 	/M1
N 	)O1
P 	)Q1
R $1 +3)a1
Hr0   r   )centrecenterleftrightjustifyc                 j    UR                  U R                  5       S 5      nUc  [        U < S35      eU$ )Nz is illegal value for alignment)rE   lower
ValueError)v__map___s      r-   r   r      s6    
 	AGGId#Ay
aU*I#JKKHr0   c                   $    \ rS rSrS\S.rS rSrg)r      r   )widthcolorc                 &    UR                  S5        g)zCYou can ask a LineStyle to set up the canvas for drawing
the lines.r   N)setLineWidth)r+   canvass     r-   prepareCanvasLineStyle.prepareCanvas   s     	Ar0   r#   N)r&   rQ   rR   rS   r
   r$   r   rT   r#   r0   r-   r   r      s    
Hr0   r   c                   6    \ rS rSr\" SSSS\SSSSS	S
S
S9rSrg
)r         r	   r   1	Helveticar[   autoltrN)r\   r]   bulletAlign
bulletTypebulletColorrb   rc   bulletOffsetYbulletDedent	bulletDirbulletFormatrs   r#   )r&   rQ   rR   rS   dictr
   r$   rT   r#   r0   r-   r   r      s0    "!*!#!Hr0   r   c                   R    \ rS rSrSrS rS r\4S jrS r	S r
SS	 jrS
 rS rSrg)r      a  
This may or may not be used.  The idea is to:

1. slightly simplify construction of stylesheets;

2. enforce rules to validate styles when added
   (e.g. we may choose to disallow having both
   'heading1' and 'Heading1' - actual rules are
   open to discussion);
   
3. allow aliases and alternate style lookup
   mechanisms
   
4. Have a place to hang style-manipulation
   methods (save, load, maybe support a GUI
   editor)

Access is via getitem, so they can be
compatible with plain old dictionaries.
c                      0 U l         0 U l        g r2   )byNamebyAliasr9   s    r-   r.   StyleSheet1.__init__   s    r0   c                      U R                   U   $ ! [         a/     U R                  U   s $ ! [         a    [        SU-  5      ef = ff = f)Nz"Style '%s' not found in stylesheet)r   KeyErrorr   r+   r4   s     r-   __getitem__StyleSheet1.__getitem__   s_    	K<<$$ 	KK{{3'' KCcIJJK	Ks    
A
-A
AA
c                 F     X   $ ! [          a    U[        :w  a  Us $ e f = fr2   )r   _stylesheet1_undefined)r+   r4   defaults      r-   rE   StyleSheet1.get   s.    	9 	..w	s      c                 H    XR                   ;   =(       d    XR                  ;   $ r2   r   r   r   s     r-   __contains__StyleSheet1.__contains__   s    ll"8c[[&88r0   c                 
    X;   $ r2   r#   r   s     r-   has_keyStyleSheet1.has_key   s
    {r0   Nc                 Z   UR                   nX0R                  ;   a  [        SU-  5      eX0R                  ;   a  [        SU-  5      eU(       a:  X R                  ;   a  [        SU-  5      eX R                  ;   a  [        SU-  5      eXR                  U'   U(       a  XR                  U'   g g )Nz(Style '%s' already defined in stylesheetz1Style name '%s' is already an alias in stylesheetz1Alias name '%s' is already an alias in stylesheet)r!   r   r   r   )r+   stylealiasr4   s       r-   addStyleSheet1.add   s    jj++EKLL,,NQTTUU#IEQRR$RUZZ[[ C"'LL r0   c                 x    X;   a  U R                  U5      $ [        U R                  R                   SU< 35      e)Nz instance has no attribute )rE   AttributeErrorr%   r&   )r+   as     r-   __getattr__StyleSheet1.__getattr__  s8    9TXXa[( 7 788STUSXYZZr0   c                 T   [        U R                  R                  5       5      nUR                  5         0 n[        U R                  R                  5       5       H	  u  p4X2U'   M     U H=  u  pTUR                  US 5      n[        XS5        UR                  S5        [        5         M?     g )Nz    )rA   r   r3   rC   r   rE   r@   rH   )r+   stylesaliir   r   r!   s         r-   rA   StyleSheet1.list  s    dkk'')*"4<<#5#5#78NUK 9#MTHHUD)E$OOF#G	 $r0   r   r2   )r&   rQ   rR   rS   __doc__r.   r   r   rE   r   r   r   r   rA   rT   r#   r0   r-   r   r      s6    *K 4 9("[
r0   r   c                      [        SS 5      n [        U l        SU l        SU l        U R                  5         [        5         [        SU 5      nSUl        UR                  5         X4$ )NNormalr[   g,@LiteralCourier)r   ry   rW   rX   rZ   rH   r@   )pNormalpPres     r-   
testStylesr     s[    Xd+G$GGGO	G)W-DDMNN=r0   c                  8   [        5       n U R                  [        S[        SSS95        U R                  [        SU S   SS95        U R                  [        SU S   [        S	95        U R                  [        S
U S   [
        SSSS9SS9  U R                  [        SU S   [
        SS[        SS9SS9  U R                  [        SU S   [
        SSSSS9SS9  U R                  [        SU S   [        SSSSS9SS9  U R                  [        SU S   [        SSSSS9SS9  U R                  [        SU S   [
        SSSSS9S S9  U R                  [        S!U S   [
        S"S#SS$S9S%S9  U R                  [        S&U S   S'S(S)9S*S9  U R                  [        S+U S   S'S,S'S[        S-9S.S9  U R                  [        S/U S   S0SS1S'S,S2S395        U R                  [        S4S5SS'S6S7[        S8SS'S9S:S5S5S;9S<S9  U R                  [        S=S5SS'S6S7[        S8SS'S9S:S5S5S;9S>S9  U $ )?zReturns a stylesheet objectr   rY   r[   )r!   rW   rX   rZ   BodyText   )r!   r"   r`   Italic)r!   r"   rW   Heading1r      )r!   r"   rW   rX   rZ   ra   h1)r   Title)r!   r"   rW   rX   rZ   r_   ra   titleHeading2   )r!   r"   rW   rX   rZ   r`   ra   h2Heading3h3Heading4   h4Heading5	   g%@   h5Heading6   g @   h6Bulletr	      )r!   r"   r^   r`   bu
Definition$   )r!   r"   r^   r\   rd   r`   rb   dfCoder   g!@rP   )r!   r"   rW   rX   rZ   r^   r\   r   UnorderedListNr   r   r   r   r   )r!   r"   r\   r]   r   r   r   rb   rc   r   r   r   r   rs   ulOrderedListol)
r   r   r   ry   _baseFontNameI_baseFontNameBr   _baseFontNameBIr   r
   )
stylesheets    r-   r   r   (  s!   JNN>x+8+-*,.  NN>z)3H)=./1  NN>x)3J)?-;= 
 NN>z)3H)=-;+-*,-.0    NN>w)3H)=-;+-*,,5-.0 !  " NN>z)3H)=-;+-*,.0-.0    NN>z)3H)=-<+-*,.0-.0    NN>z)3H)=-<+-*,.0-.0    NN>z)3H)=-;+,*../-.0    NN>z)3H)=-;+,*-./-.0    NN>x)3H)=23./1 	   NN>|)3H)=23-//0./1@B    NN>v)3H)=+4+,*-23-/246 7 NN9/'++-,-,2+.,1/:/1./-3*/-1&*  !  $ NN9-'++-,-,2+.,1/:/1./-3*/-1&*  !  " r0   N)5__version__r   __all__reportlab.lib.colorsr
   reportlab.lib.enumsr   r   r   r   reportlab.lib.fontsr   reportlab.rl_configr   ry   r   rz   r   r}   r   r~   r   r|   r   r   r   r   r   r{   r   r   r   r   r   _hyphenationMinWordLengthr   r   r   r   r   r   r   r   r   r   r   r   r   objectr   r   r   r   r#   r0   r-   <module>r     s    		
 ' H H %L L L L }Qq)}Qq)a*; ;z2
[ 2
h !&&"(	*       O ObLr0   