HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/share/inkscape/extensions/text_merge.pyc
�
��Yc@s�dZddlZddlZddlZddlZddlZddlZy ddlmZm	Z	e
ZWn
eZnXddl
Z
de
jfd��YZedkr�e�Zej�ndS(sm
Copyright (C) 2013 Nicolas Dufour (jazzynico)
Direction code from the Restack extension, by Rob Antonishen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

i����N(tPopentPIPEtMergecBs#eZd�Zd�Zd�ZRS(c
Cs	tjj|�|jjddddddddd	d
dd�|jjd
dddddddd	ddd�|jjddddddddd	ddd�|jjddddddddd	tdd�|jjddddddddd	tdd�dS(Ns-ds--directiontactiontstorettypetstringtdestt	directiontdefaultttbthelpsdirection to merge texts-xs	--xanchortxanchortmshorizontal point to compares-ys	--yanchortyanchorsvertical point to compares-ts
--flowtexttinkbooltflowtexts:use a flow text structure instead of a normal text elements-ks--keepstylet	keepstyleskeep format(tinkextEffectt__init__tOptionParsert
add_optiontFalse(tself((s,/usr/share/inkscape/extensions/text_merge.pyR*s*cCs�t|j�dkrTx<|jjddtj�D]}||j|jd�<q1Wnt|j�dkr�g}|jj�}|j}|j	d}t
r td|dtdt
d	t
�}|j}|j�d}ytj�j|�}	Wn"tj|jtj��}	nX|j�n5tjd|�\}
}}tj|�}	|j�t�}x>|	D]6}t|�dkrett|d
�||d<qeqeWt
s�|jn||jj�d\}
}}}|
}|}|
|}||}x�|jj�D]�\}}||\}
}}}|
|kr9|
}n|
||krV|
|}n||krk|}n|||kr||}qqW||d}||d}xe|jj�D]T\}}||\}
}}}|jjdkr�|
}n-|jjd
kr|
|}n|
|d}|jj dkr=|}n-|jj dkr\||}n||d}|jj!dkr�|j"||g�q�|jj!dkr�|j"||g�q�|jj!dkr�|j"||g�q�|jj!dkr�|j"||g�q�q�W|j#�|jj$r;d|_%d|_&nd|_%d|_&tj'j(|tj)|j%d�idtj)dd�6�|_*|j*j+tj)dd�d�x,|D]$}|j,|j|d
|j*�q�W|jj$r�tj'j(|j*tj)dd�idtj)dd�6�|_-tj'j(|j-tj)d d�idtj)dd�6�|_.|j.j+tj)d!d�d"�|j.j+tj)d#d�d"�q�ndS($Nis//svg:text | //svg:flowRoott
namespacestidi����sinkscape --query-all "%s"tshelltstdouttstderriitltrtttbR
tbttlrtrltflowRoottflowParattextttspantsvgtpreservetspacetxmltstylets�font-size:20px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;t
flowRegiontrecttheightt200twidth(/tlentselectedtdocumenttxpathRtNSStgettgetroott
current_layertargstbsubprocessRtTrueRRtcommunicatetcsvt	CSVParsertparse_stringtreadertsplittostlineseptclosetpopen3tdicttmaptfloattkeyst	iteritemstoptionsRRRtappendtsortRttext_elementt	text_spantetreet
SubElementtaddNSttextRoottsettrecursetregionR0(RtnodetobjlistR)t
parentnodetfiletpterrtfRCt_tdimentlinetxtytwthtminxtminytmaxxtmaxyRtmidxtmidytcxtcytitem((s,/usr/share/inkscape/extensions/text_merge.pyteffectAs�"	
"	

	
"
#

	
		
	

			=
"==cCsp|jdkrltjj|tj|jd�idtjdd�6�}|jd�r�|jtjdd�|jd��n|jd	ks�|jd
kr�|jtjdd�d�n|jj	r|jd�r|jtjdd
�|jd��qn|j
dkr!|j
|_
nx|D]}|j||�q(W|j
rl|jd	krl|j
|_
qlndS(Ns&{http://www.w3.org/2000/svg}flowRegionR)R*R+R,s8{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}roletroletsodipodis {http://www.w3.org/2000/svg}texts${http://www.w3.org/2000/svg}flowParaRcR-R.(ttagRRSRTRURRR9RWRNRR'tNoneRXttail(RRZtspantnewspantchild((s,/usr/share/inkscape/extensions/text_merge.pyRX�s:(+
(t__name__t
__module__RRqRX(((s,/usr/share/inkscape/extensions/text_merge.pyR)s		nt__main__(t__doc__tchardataeffecttcopyR@tmathRERt
subprocessRRR>R=RRRRRztetaffect(((s,/usr/share/inkscape/extensions/text_merge.pyt<module>s 

�