
    p"h                         S r SSKJr  SSKJrJrJr  SSK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 S\\\5      rg)z
Text that is to be rendered as part of an SVG document fragment is specified
using the **text** element. The characters to be drawn are expressed as XML
character data inside the **text** element.

    )BaseElement)Presentation	TransformXLink)iterflatliststrlist	is_stringc                   @   ^  \ rS rSrSrSrSU 4S jjrU 4S jrSrU =r	$ )TSpan   a  
Within a **Text** element, text and font properties
and the current text position can be adjusted with absolute or relative
coordinate values by using the **TSpan** element.
The characters to be drawn are expressed as XML character data inside the
**TSpan** element.

tspanc                 *  > [         [        U ]
  " S0 UD6  Xl        Ub@  [	        U5      (       a  [        S5      eU(       d  U(       a  [        S5      eUS   /nUS   /nUb!  [        [        [        U5      5      S5      U S'   Ub!  [        [        [        U5      5      S5      U S'   Ub!  [        [        [        U5      5      S5      U S	'   Ub!  [        [        [        U5      5      S5      U S
'   Ub"  [        [        [        U5      5      S5      U S'   gg)a=  
:param string text: **tspan** content
:param 2-tuple insert: The **insert** parameter is the absolute insert point
                       of the text, don't use this parameter in combination
                       with the **x** or the **y** parameter.
:param list x: list of absolute x-axis values for characters
:param list y: list of absolute y-axis values for characters
:param list dx: list of relative x-axis values for characters
:param list dy: list of relative y-axis values for characters
:param list rotate: list of rotation-values for characters (in degrees)

NzE'insert' should be a <tuple> or a <list>  with at least two elements.z;Use 'insert' and 'x' or 'y' parameter not at the same time!r       xydxdyrotate )
superr   __init__textr	   	TypeError
ValueErrorr   listr   )
selfr   insertr   r   r   r   r   extra	__class__s
            ?/var/www/html/env/lib/python3.13/site-packages/svgwrite/text.pyr   TSpan.__init__   s    	eT#,e,	   !: ; ;A  "6 7 7AA=\!_ 5s;DI=\!_ 5s;DI> l2&6!7=DJ> l2&6!7=DJ$T,v*>%?EDN     c                 `   > [         [        U ]  5       n[        U R                  5      Ul        U$ N)r   r   get_xmlstrr   r   xmlr    s     r!   r&   TSpan.get_xmlD   s&    E4(*tyy>
r#   r   )NNNNNN
__name__
__module____qualname____firstlineno____doc__elementnamer   r&   __static_attributes____classcell__r    s   @r!   r   r      s      K#FJ r#   r   c                       \ rS rSrSrSrSrg)TextJ   z
The **Text** element defines a graphics element consisting of text.
The characters to be drawn are expressed as XML character data inside the
**Text** element.

r   r   N)r-   r.   r/   r0   r1   r2   r3   r   r#   r!   r7   r7   J   s     Kr#   r7   c                   <   ^  \ rS rSrSrSrU 4S jrU 4S jrSrU =r	$ )TRefT   z
The textual content for a **Text** can be either character data directly
embedded within the <text> element or the character data content of a
referenced element, where the referencing is specified with a **TRef**
element.

trefc                 P   > [         [        U ]
  " S0 UD6  U R                  U5        g)a1  
:param element: create a reference this element, if element is a                         `string` its the **id** name of the referenced element,                         if element is a :class:`~svgwrite.base.BaseElement`                         the **id** SVG Attribute is used to create the reference.

Nr   )r   r:   r   set_href)r   elementr   r    s      r!   r   TRef.__init__^   s#     	dD"+U+gr#   c                 H   > U R                  5         [        [        U ]  5       $ r%   )	update_idr   r:   r&   )r   r    s    r!   r&   TRef.get_xmli   s    T4(**r#   r   r,   r5   s   @r!   r:   r:   T   s     K	+ +r#   r:   c                   @   ^  \ rS rSrSrSrSU 4S jjrU 4S jrSrU =r	$ )TextPathn   a`  
In addition to text drawn in a straight line, SVG also includes the
ability to place text along the shape of a **path** element. To specify that
a block of text is to be rendered along the shape of a **path**, include
the given text within a **textPath** element which includes an **xlink:href**
attribute with a IRI reference to a **path** element.

textPathc                    > [         [        U ]
  " S0 UD6  X l        US:X  a  X@S'   US:X  a  XPS'   Ub  X0S'   U R	                  U5        g)a   
:param path: link to **path**, **id** string or **Path** object
:param string text: **textPath** content
:param number startOffset: text starts with offset from begin of path.
:param string method: ``align|stretch``
:param string spacing: ``exact|auto``

stretchmethodautospacingNstartOffsetr   )r   rE   r   r   r>   )r   pathr   rM   rJ   rL   r   r    s          r!   r   TextPath.__init__y   sT     	h&//	Y#Nf%O""-dr#   c                    > U R                  5         [        [        U ]  5       n[	        U R
                  5      Ul        U$ r%   )rB   r   rE   r&   r'   r   r(   s     r!   r&   TextPath.get_xml   s0    Hd+-tyy>
r#   r+   )Nalignexactr,   r5   s   @r!   rE   rE   n   s     K( r#   rE   c                   >   ^  \ rS rSrSrU 4S jrS rS rS rSr	U =r
$ )TBreak   tbreakc                 .   > [         [        U ]
  " S0 UD6  g )Nr   )r   rU   r   )r   r   r    s     r!   r   TBreak.__init__   s    fd$-u-r#   c                     [        S5      e)Nz,__getitem__() not supported by TBreak class.NotImplementedError)r   keys     r!   __getitem__TBreak.__getitem__       !"PQQr#   c                     [        S5      e)Nz,__setitem__() not supported by TBreak class.r[   )r   r]   values      r!   __setitem__TBreak.__setitem__   r`   r#   c                     [        S5      e)Nz$add() not supported by TBreak class.r[   )r   r?   s     r!   add
TBreak.add   s    !"HIIr#   r   )r-   r.   r/   r0   r2   r   r^   rc   rf   r3   r4   r5   s   @r!   rU   rU      s%    K.RRJ Jr#   rU   c                   @   ^  \ rS rSrSrSrSU 4S jjrS rS rSr	U =r
$ )	TextArea   a  
At this time **textArea** is only available for SVG 1.2 Tiny profile.

The **textArea**  element allows simplistic wrapping of text content within a
given region. The `tiny` profile of SVG specifies a single rectangular region.
Other profiles may allow a sequence of arbitrary shapes.

Text wrapping via the **textArea** element is available as a lightweight and
convenient facility for simple text wrapping where a complete box model layout
engine is not required.

The layout of wrapped text is user agent dependent; thus, content developers
need to be aware that there might be different results, particularly with
regard to where line breaks occur.

The TextArea class wraps every text added by write() or writeline() as
**tspan** element.

textAreac                    > [         [        U ]
  " S0 UD6  Ub  U R                  U5        Ub  US   U S'   US   U S'   Ub  US   U S'   US   U S'   g g )Nr   r   r   r   widthheightr   )r   ri   r   write)r   r   r   sizer   r    s        r!   r   TextArea.__init__   sl    h&//JJtq	DIq	DI GDM!!WDN r#   c                     XS'   g)z!Set the line-spacing to *value*. zline-incrementNr   )r   rb   s     r!   line_incrementTextArea.line_increment   s    !&r#   c                 J   SU;  a  U R                  [        U40 UD65        gUR                  S5      nUSS  H>  nU(       a  U R                  [        U40 UD65        U R                  [        5       5        M@     US   (       a  U R                  [        US   40 UD65        gg)zx
Add text as **tspan** elements, with extra-params for the **tspan** element.

Use the '\\n' character for line breaks.

N)rf   r   splitrU   )r   r   r   lineslines        r!   ro   TextArea.write   s     tHHU4)5)*JJt$Ecr
HHU41512" # RyuRy2E23 r#   r   )NNN)r-   r.   r/   r0   r1   r2   r   rs   ro   r3   r4   r5   s   @r!   ri   ri      s#    & K	%'4 4r#   ri   N)r1   svgwrite.baser   svgwrite.mixinsr   r   r   svgwrite.utilsr   r   r	   r   r7   r:   rE   rU   ri   r   r#   r!   <module>r      sw    & : : ; ;3K 3l5) +;| +4#{E< #LJ[ J 64{I| 64r#   