
    kfOC                        d Z dZdZddlmZ ddlmZmZmZm	Z	 ddl
mZ ddlmZmZmZmZmZmZmZmZmZmZ m!Z"m#Z$m%Z&  eedd          Z' eedd          Z( eedd          Z) G d	 d
          Z* G d de*          Z+ e,eeeee	          fdZ- G d de*          Z. G d de*          Z/ e0            Z1 G d d          Z2d Z3d Z4dS )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                   <    e Zd Zi Zd	dZd Zd Zd Zd
dZd	dZ	dS )r   Nc                 Z   d| j         vs
J d            d| j         vs
J d            |r4|j        | j        k    s$J d|j        j        d| j        j                    || _        || _        | j                            | j                    |                                   | j        di | dS )	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       T/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/reportlab/lib/styles.py__init__zPropertySet.__init__6   s     T]***,_***t},,,.c,,, 	d#t~5555qw  rB  rK  rK  rK  LP  LZ  Lc  Lc  8d555 	T]+++
 	    c                 N    |                                 D ]\  }}|| j        |<   d S N)itemsr&   )r*   r+   keyvalues       r,   r)   zPropertySet._setKwdsL   s6    ((** 	( 	(JC"'T]3	( 	(r.   c                 2    d| j         j        d| j        dS )N<z 'z'>)r$   r%   r    r*   s    r,   __repr__zPropertySet.__repr__Q   s      "n555tyyyAAr.   c                 |    | j         r2| j         j                                        D ]\  }}|dvr
|| j        |<   dS dS )zre-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&   r1   )r*   r2   r3   s      r,   r(   zPropertySet.refreshT   s_     ; 	/"k288:: / /
U000).DM#&	/ 	// /r.    c                    t          |dz   | j                   t          |dz   | j                   t          | j                                                  }|                                 |                    d           |                    d           |D ]4}| j                            |d           }t          ||d|z              5d S )Nzname =zparent =r    r!   z = )	printr    r!   listr&   keyssortremoveget)r*   indentkeylistr2   r3   s        r,   	listAttrszPropertySet.listAttrs]   s    fx+++fz!4;///t}))++,,vx    	5 	5CM%%c400E&UU334444	5 	5r.   c                     |                      ||          }| j                                        |_        ||_        |d u r| p||_         |j        di | |S )Nr"   )r$   r&   copyr    r!   r)   )r*   r    r!   kwdsrs        r,   clonezPropertySet.cloneh   sc    NN4'']''))
T>*d4f
Tr.   r0   )r9   )
r%   
__module____qualname__r#   r-   r)   r7   r(   rC   rH   r"   r.   r,   r   r   3   s        H   ,( ( (
B B B/ / /	5 	5 	5 	5     r.   r   c                       e Zd Zi deddddddddd	dd
edddddedddddeddddddddi dddddddddddddddedd d!dd"dd#ed$ed%e	d&e
d'ed(eeddeeed)ZdS )*r   fontNamefontSize
   leading   
leftIndentr	   rightIndentfirstLineIndent	alignmentspaceBefore
spaceAfterbulletFontNamebulletFontSizebulletIndent	textColor	backColorNwordWrapborderWidthborderPaddingborderColorborderRadiusallowWidowsr   allowOrphanstextTransformendDotssplitLongWordsr   bulletAnchorstartjustifyLastLinejustifyBreaksr   r   r   r   r   r   )linkUnderlineunderlineColorstrikeColorr   r   r   )r%   rI   rJ   _baseFontNamer   r
   _baseUnderlineWidth_spaceShrinkage_baseStrikeWidth_baseUnderlineOffset_baseUnderlineGap_baseStrikeOffset_baseStrikeGap_platypus_link_underline_hyphenationLang_embeddedHyphenation_uriWasteReducer#   r"   r.   r,   r   r   p   s       0
=0
20
 	"0
 	Q	0

 	a0
 	!0
 	G0
 	a0
 	Q0
 	0
 	0
 	q0
 	U0
 	D0
  	4!0
( 	q)0
* 	+0
 0
, 	t-0
. 	/0
0 	q10
2 	30
4 	50
6 	$70
< 	=0
> 	-?0
@ 	A0
B 	1C0
D 	E0
F 	/G0
H 	'I0
J 	/K0
L 	)M0
N 	)O0
P 	^Q0
 0
R 2 +3)_0
 0
 0
HHHr.   r   )centrecenterleftrightjustifyc                 ~    |                     |                                 d           }||S t          | d          )Nz is illegal value for alignment)r@   lower
ValueError)v__map___s      r,   r   r      s@    
 AGGIId++A} A!H!H!HIIIr.   c                       e Zd ZdedZd ZdS )r   r   )widthcolorc                 0    |                     d           dS )zKYou can ask a LineStyle to set up the canvas for drawing
        the lines.r   N)setLineWidth)r*   canvass     r,   prepareCanvaszLineStyle.prepareCanvas   s     	Ar.   N)r%   rI   rJ   r
   r#   r   r"   r.   r,   r   r      s5        
 
H    r.   r   c                   <    e Zd Z eddddedddddd	d	
          Zd	S )r      r	   r{   1	HelveticarP   autoltrN)rQ   rR   bulletAlign
bulletTypebulletColorrW   rX   bulletOffsetYbulletDedent	bulletDirbulletFormatrg   )r%   rI   rJ   dictr
   r#   r"   r.   r,   r   r      sH        t"!*!#!  HHHr.   r   c                   B    e Zd ZdZd Zd ZefdZd Zd Z	d
dZ
d	 ZdS )r   aG  
    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                 "    i | _         i | _        d S r0   )byNamebyAliasr6   s    r,   r-   zStyleSheet1.__init__   s    r.   c                     	 | j         |         S # t          $ r1 	 | j        |         cY S # t          $ r t          d|z            w xY ww xY w)Nz"Style '%s' not found in stylesheet)r   KeyErrorr   r*   r2   s     r,   __getitem__zStyleSheet1.__getitem__   s    	K<$$ 	K 	K 	KK{3'''' K K KCcIJJJK	Ks    
A
)A
AA
c                 P    	 | |         S # t           $ r |t          k    r|cY S  w xY wr0   )r   _stylesheet1_undefined)r*   r2   defaults      r,   r@   zStyleSheet1.get   sC    	9 	 	 	...w	s   
 %%c                 &    || j         v p|| j        v S r0   )r   r   r   s     r,   __contains__zStyleSheet1.__contains__   s    dl"8cT[&88r.   c                 
    || v S r0   r"   r   s     r,   has_keyzStyleSheet1.has_key   s    d{r.   Nc                     |j         }|| j        v rt          d|z            || j        v rt          d|z            |r6|| j        v rt          d|z            || j        v rt          d|z            || j        |<   |r|| j        |<   d S d S )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aliasr2   s       r,   addzStyleSheet1.add   s    j$+EKLLL$,NQTTUUU 	\##IEQRRR$$RUZZ[[[ C 	("'DL	( 	(r.   c                    t          | j                                                  }|                                 i }t          | j                                                  D ]
\  }}|||<   |D ]N\  }}|                    |d           }t          ||           |                    d           t                       Od S )Nz    )r<   r   r1   r>   r   r@   r;   rC   )r*   stylesaliir   r   r    s         r,   r<   zStyleSheet1.list  s    dk''))**"4<#5#5#7#788 	  	 NUEDKK# 	 	MT5HHUD))E$OOF###GGGG		 	r.   r0   )r%   rI   rJ   __doc__r-   r   r   r@   r   r   r   r<   r"   r.   r,   r   r      s         *  K K K 4    9 9 9  ( ( ( ("
 
 
 
 
r.   r   c                      t          dd           } t          | _        d| _        d| _        |                                  t                       t          d|           }d|_        |                                 | |fS )NNormalrP   g,@LiteralCourier)r   rm   rL   rM   rO   rC   r;   )pNormalpPres     r,   
testStylesr     ss    Xd++G$GGGO	GGG)W--DDMNND=r.   c                  .   t                      } |                     t          dt          dd                     |                     t          d| d         d                     |                     t          d| d         t          	                     |                     t          d
| d         t
          ddd          d           |                     t          d| d         t
          ddt          d          d           |                     t          d| d         t
          dddd          d           |                     t          d| d         t          dddd          d           |                     t          d| d         t          dddd          d           |                     t          d| d         t
          dddd          d            |                     t          d!| d         t
          d"d#dd$          d%           |                     t          d&| d         d'd()          d*           |                     t          d+| d         d'd,d'dt          -          d.           |                     t          d/| d         d0dd1d'd,d23                     |                     t          d4d5dd'd6d7t          d8dd'd9d:d5d5;          d<           |                     t          d=d5dd'd6d7t          d8dd'd9d:d5d5;          d>           | S )?zReturns a stylesheet objectr   rN   rP   )r    rL   rM   rO   BodyText   )r    r!   rU   Italic)r    r!   rL   Heading1r      )r    r!   rL   rM   rO   rV   h1)r   Title)r    r!   rL   rM   rO   rT   rV   titleHeading2   )r    r!   rL   rM   rO   rU   rV   h2Heading3h3Heading4   h4Heading5	   g%@   h5Heading6   g @   h6Bulletr	      )r    r!   rS   rU   bu
Definition$   )r    r!   rS   rQ   rY   rU   rW   dfCoder   g!@r9   )r    r!   rL   rM   rO   rS   rQ   r   UnorderedListNr{   r   r   r   r   )r    r!   rQ   rR   r   r   r   rW   rX   r   r   r   r   rg   ulOrderedListol)
r   r   r   rm   _baseFontNameI_baseFontNameBr   _baseFontNameBIr   r
   )
stylesheets    r,   r   r   %  sQ   JNN>x+8+-*,. . .    NN>z)3H)=./1 1 1    NN>x)3J)?-;= = =   
 NN>z)3H)=-;+-*,-.0 0 0      NN>w)3H)=-;+-*,,5-.0 0 0 !  " " " NN>z)3H)=-;+-*,.0-.0 0 0      NN>z)3H)=-<+-*,.0-.0 0 0      NN>z)3H)=-<+-*,.0-.0 0 0      NN>z)3H)=-;+,*../-.0 0 0      NN>z)3H)=-;+,*-./-.0 0 0      NN>x)3H)=23./1 1 1 	     NN>|)3H)=23-//0./1@B B B      NN>v)3H)=+4+,*-23-/246 6 6 7 7 7 NN9/'++-,-,2+.,1/:/1./-3*/-1&*    !    $ NN9-'++-,-,2+.,1/:/1./-3*/-1&*    !    " r.   N)5__version__r   __all__reportlab.lib.colorsr
   reportlab.lib.enumsr   r   r   r   reportlab.lib.fontsr   reportlab.rl_configr   rm   r   rn   r   rq   r   rr   r   rp   r   rs   r   rt   r   ro   r   ru   r   rv   r   _hyphenationMinWordLengthr   rx   r   rw   r   r   r   r   r   r   r   r   r   objectr   r   r   r   r"   r.   r,   <module>r      s   		
 ' & & & & & H H H H H H H H H H H H % % % % % %L L L L L L L L L L L L L L L L L L L L L L L L L L L L L L }Qq))}Qq))%a**; ; ; ; ; ; ; ;z1
 1
 1
 1
 1
[ 1
 1
 1
f !D&&"(	* * * 	J 	J 	J 	J                  K K K K K K K KZ  L L L L Lr.   