bgdZddlmZddlmZmZmZddlmZm Z m Z GddeeZ Gdde eZ Gd d eeeZ Gd d eeeZGd deZGddeeeZdS)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 TransformXLink) iterflatliststrlist is_stringc2eZdZdZdZdfd ZfdZxZS)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 |rt d|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 or a with at least two elements.z;Use 'insert' and 'x' or 'y' parameter not at the same time!r xydxdyrotate) superr __init__textr TypeError ValueErrorrlistr) selfrinsertrrrrrextra __class__s ^/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/svgwrite/text.pyrzTSpan.__init__si $eT#,,e,,,     ;!:;;; 7A 7 "6777 A A =\!__ 5 5s;;DI =\!__ 5 5s;;DI > l2&6&6!7!7==DJ > l2&6&6!7!7==DJ  $T,v*>*>%?%?EEDNNN  ctt|}t|j|_|SN)rr get_xmlstrrrxmlrs r r$z TSpan.get_xmlDs2E4  ((**ty>> r!)NNNNNN__name__ __module__ __qualname____doc__ elementnamerr$ __classcell__rs@r r r snK#F#F#F#F#F#FJr!r ceZdZdZdZdS)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 KKKr!r1c0eZdZdZdZfdZfdZxZS)TRefz The textual content for a **Text** can be either character data directly embedded within the element or the character data content of a referenced element, where the referencing is specified with a **TRef** element. trefc rtt|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)rr3rset_href)relementrrs r rz TRef.__init__^s@ #dD"++U+++ gr!cz|tt|Sr#) update_idrr3r$)rrs r r$z TRef.get_xmlis/ T4  ((***r!r(r/s@r r3r3TsbK     +++++++++r!r3c2eZdZdZdZdfd ZfdZxZS) 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. textPathNalignexactc 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`` stretchmethodautospacingN startOffsetr)rr;rrr6)rpathrrDrArCrrs r rzTextPath.__init__ys 'h&///// Y  #DN f  %DO  ""-D  dr!c|tt|}t |j|_|Sr#)r9rr;r$r%rr&s r r$zTextPath.get_xmlsB Hd##++--ty>> r!)Nr=r>r(r/s@r r;r;nsgK(r!r;c4eZdZdZfdZdZdZdZxZS)TBreaktbreakc Htt|jdi|dS)Nr)rrHr)rrrs r rzTBreak.__init__s,$fd$--u-----r!c td)Nz,__getitem__() not supported by TBreak class.NotImplementedError)rkeys r __getitem__zTBreak.__getitem__!"PQQQr!c td)Nz,__setitem__() not supported by TBreak class.rL)rrNvalues r __setitem__zTBreak.__setitem__rPr!c td)Nz$add() not supported by TBreak class.rL)rr7s r addz TBreak.adds!"HIIIr!) r)r*r+r-rrOrSrUr.r/s@r rHrHswK.....RRRRRRJJJJJJJr!rHc4eZdZdZdZdfd ZdZdZxZS)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)Nrrrrwidthheightr)rrWrwrite)rrrsizerrs r rzTextArea.__init__s&h&/////   JJt     q DIq DI   GDM!!WDNNN  r!c||d<dS)z" Set the line-spacing to *value*. zline-incrementNr)rrRs r line_incrementzTextArea.line_increments!& r!c |d|vr"|t|fi|dS|d}|ddD]E}|r |t|fi||tF|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)rrrlineslines r r\zTextArea.writes t   HHU4))5)) * * * * *JJt$$Ecrc  # #3HHU411511222""""Ry 4uRy22E2233333 4 4r!)NNN) r)r*r+r,r-rr_r\r.r/s@r rWrWsl&K % % % % % %'''4444444r!rWN)r, svgwrite.basersvgwrite.mixinsrrrsvgwrite.utilsrrr r r1r3r;rHrWrr!r ris&%%%%%::::::::::;;;;;;;;;;33333K333l5)+++++;|+++4#####{E<###L J J J J J[ J J J 6464646464{I|6464646464r!