L iBddlmZddlmZddgZGddeZddZy) )pairwise)ContourFilterPenreversedContourReverseContourPenc*eZdZdZdfd ZdZxZS)raFilter pen that passes outline data to another pen, but reversing the winding direction of all contours. Components are simply passed through unchanged. Closed contours are reversed in such a way that the first point remains the first point. c2t||||_yN)super__init__outputImpliedClosingLine)selfoutPenr __class__s f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/pens/reverseContourPen.pyr zReverseContourPen.__init__s  (@%c.t||jSr )rr )r contours r filterContourzReverseContourPen.filterContoursw(E(EFFrF)__name__ __module__ __qualname____doc__r r __classcell__)rs@rrrsAGrc #K|syt|dkDsJd|jd}|dvsJ|dk(}|jd\}}|dvs Jd|z|d }|d k(r3|Jd |rJd |dftt|dd zd z}|s|dk(rd}nd}||fn|d \}}|d } |rl||f|| k7rd| ff|t|dd |fzf|d <t|dkDr |d\} } n||} } |sD| dk(r?|| k7r:|d=|r5|t|dd | zf|d <n|| ff|t|dd |fzf|d <t |dD]-\\} } \}}| tt| dd |d fzf/|rdnddfyw)zGenerator that takes a list of pen's (operator, operands) tuples, and yields them with the winding direction reversed. Nzinvalid contourr)endPath closePathr)moveToqCurveToz invalid initial segment type: %rr z)off-curve only paths must end with 'None'z,only one qCurveTo allowed per off-curve pathr rFTlineTo)reverser)lenpoptuplereversedr)rr contourTypeclosed firstTypefirstPts firstOnCurvelastTypelastPts lastOnCurve secondType secondPtscurTypecurPts_nextPtss rrrsD  wE(8Ab>*B$CCgM   FF!!#BK'bk X% %{*..'ws|)< )NO 7|a(/ % I)1'I + )h).C '/ws|1Dy1P&Q k^+ +#U73B<%8L?%JKGBK 08/N I + Wf|75&"+!6772;.HH H I +Y 22sF F Nr)fontTools.misc.arrayToolsrfontTools.pens.filterPenr__all__rrr$rrr:s-.5 1 2G(G"G3r