Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/svgwrite/__pycache__/text.cpython-311.pyc

�

�܋f����dZddlmZddlmZmZmZddlmZm	Z	m
Z
Gd�dee��ZGd�dee��ZGd	�d
eee��Z
Gd�deee��ZGd
�de��ZGd�deee��ZdS)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�2��eZdZdZdZd�fd�	Z�fd�Z�xZS)�TSpana%
    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.

    �tspanNc���tt|��jdi|��||_|�Ct	|��rtd���|s|rt
d���|dg}|dg}|�-ttt|����d��|d<|�-ttt|����d��|d<|�-ttt|����d��|d	<|�-ttt|����d��|d
<|�/ttt|����d��|d<dSdS)
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�insertrrrrr�extra�	__class__s
         ��^/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/svgwrite/text.pyrzTSpan.__init__si���	$��e�T���#�,�,�e�,�,�,���	����� � �
;��!:�;�;�;��
7�A�
7� �"6�7�7�7�����A�����A��=���\�!�_�_� 5� 5�s�;�;�D��I��=���\�!�_�_� 5� 5�s�;�;�D��I�
�>� ��l�2�&6�&6�!7�!7��=�=�D��J�
�>� ��l�2�&6�&6�!7�!7��=�=�D��J���$�T�,�v�*>�*>�%?�%?��E�E�D��N�N�N���c���tt|�����}t|j��|_|S�N)rr�get_xml�strr�r�xmlrs  �r r$z
TSpan.get_xmlDs2����E�4� � �(�(�*�*���t�y�>�>����
r!)NNNNNN��__name__�
__module__�__qualname__�__doc__�elementnamerr$�
__classcell__�rs@r rrsn����������K�#F�#F�#F�#F�#F�#F�J��������r!rc��eZdZdZdZdS)�Textz�
    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.

    rN)r)r*r+r,r-rr!r r1r1Js���������K�K�Kr!r1c�0��eZdZdZdZ�fd�Z�fd�Z�xZS)�TRefz�
    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�r��tt|��jdi|��|�|��dS)aA
        :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)rr3r�set_href)r�elementrrs   �r rz
TRef.__init__^s@���	#��d�D���"�+�+�U�+�+�+��
�
�g�����r!c�z��|���tt|�����Sr#)�	update_idrr3r$)rrs �r r$zTRef.get_xmlis/����������T�4� � �(�(�*�*�*r!r(r/s@r r3r3Tsb����������K�	�	�	�	�	�+�+�+�+�+�+�+�+�+r!r3c�2��eZdZdZdZd�fd�	Z�fd�Z�xZS)	�TextPathax
    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.

    �textPathN�align�exactc���tt|��jdi|��||_|dkr||d<|dkr||d<|�||d<|�|��dS)a0
        :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)rr;rrr6)r�pathrrDrArCrrs       �r rzTextPath.__init__ys���	'��h����&�/�/��/�/�/���	��Y���#�D��N��f���%�D��O��"�"-�D����
�
�d�����r!c���|���tt|�����}t	|j��|_|Sr#)r9rr;r$r%rr&s  �r r$zTextPath.get_xml�sB����������H�d�#�#�+�+�-�-���t�y�>�>����
r!)Nr=r>r(r/s@r r;r;nsg����������K�������(��������r!r;c�4��eZdZdZ�fd�Zd�Zd�Zd�Z�xZS)�TBreak�tbreakc�H��tt|��jdi|��dS)Nr)rrHr)rrrs  �r rzTBreak.__init__�s,���$��f�d���$�-�-�u�-�-�-�-�-r!c� �td���)Nz,__getitem__() not supported by TBreak class.��NotImplementedError)r�keys  r �__getitem__zTBreak.__getitem__����!�"P�Q�Q�Qr!c� �td���)Nz,__setitem__() not supported by TBreak class.rL)rrN�values   r �__setitem__zTBreak.__setitem__�rPr!c� �td���)Nz$add() not supported by TBreak class.rL)rr7s  r �addz
TBreak.add�s��!�"H�I�I�Ir!)	r)r*r+r-rrOrSrUr.r/s@r rHrH�sw��������K�.�.�.�.�.�R�R�R�R�R�R�J�J�J�J�J�J�Jr!rHc�4��eZdZdZdZd�fd�	Zd�Zd�Z�xZS)�TextAreaa
    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.

    �textAreaNc����tt|��jdi|��|�|�|��|�|d|d<|d|d<|�|d|d<|d|d<dSdS)Nrrrr�width�heightr)rrWr�write)rrr�sizerrs     �r rzTextArea.__init__�s����&��h����&�/�/��/�/�/����J�J�t�������q�	�D��I��q�	�D��I��� ��G�D��M�!�!�W�D��N�N�N��r!c��||d<dS)z" Set the line-spacing to *value*. zline-incrementNr)rrRs  r �line_incrementzTextArea.line_increment�s��!&��
���r!c�|�d|vr"|�t|fi|����dS|�d��}|dd�D]E}|r |�t|fi|����|�t�����F|dr(|�t|dfi|����dSdS)z�
        Add text as **tspan** elements, with extra-params for the **tspan** element.

        Use the '\\n' character for line breaks.
        �
N���)rUr�splitrH)rrr�lines�lines     r r\zTextArea.write�s����t����H�H�U�4�)�)�5�)�)�*�*�*�*�*��J�J�t�$�$�E��c�r�c�
�
#�
#���3��H�H�U�4�1�1�5�1�1�2�2�2�������"�"�"�"��R�y�
4�����u�R�y�2�2�E�2�2�3�3�3�3�3�
4�
4r!)NNN)	r)r*r+r,r-rr_r\r.r/s@r rWrW�sl���������&�K�	%�	%�	%�	%�	%�	%�'�'�'�4�4�4�4�4�4�4r!rWN)r,�
svgwrite.baser�svgwrite.mixinsrrr�svgwrite.utilsrrr	rr1r3r;rHrWrr!r �<module>ris����&�%�%�%�%�%�:�:�:�:�:�:�:�:�:�:�;�;�;�;�;�;�;�;�;�;�3�3�3�3�3�K��3�3�3�l�����5�)����+�+�+�+�+�;��|�+�+�+�4#�#�#�#�#�{�E�<�#�#�#�L
J�
J�
J�
J�
J�[�
J�
J�
J� 64�64�64�64�64�{�I�|�64�64�64�64�64r!

Hacked By AnonymousFox1.0, Coded By AnonymousFox