)EjJddlmZddlmZddgZGddeZd dZdS) )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. FcXt|||_dSN)super__init__outputImpliedClosingLine)selfoutPenr __class__s RC:\PYTHON\MyICR_Suite\python\Lib\site-packages\fontTools/pens/reverseContourPen.pyr zReverseContourPen.__init__s)    (@%%%c,t||jSr )rr )r contours r filterContourzReverseContourPen.filterContoursw(EFFFrF)__name__ __module__ __qualname____doc__r r __classcell__)rs@rrrscAAAAAAGGGGGGGrFc #K|sdSt|dks Jd|d}|dvsJ|dk}|d\}}|dvs Jd|z|d }|d krI| Jd |r Jd |dftt|dd zd z}|s|dkrd}nd}||fVn|d \}}|d } |r||fV|| kr'd| ffV|t|dd |fzf|d <t|dkr |d\} } n||} } |s0| dkr*|| kr$|d=|r|t|dd | zf|d <n'|| ffV|t|dd |fzf|d <t |dD]=\\} } \}}| tt| dd |d fzfV>|rdnddfVdS)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 rrrs  w<E(8AbD>*B*B$C$CCgM *I  FFF!!!!!#BK'bk  LX% % % %{**....'wss|)<)< )NO 7||a(/ % II)1'I + R ))h).C.C R'/wss|1D1Dy1P&Q k^+ + + +#U73B3<%8%8L?%JKGBK 08/N/N/N I I + Wf|75&"+!6!67772;.HH H H H H .++Y 222222rNr)fontTools.misc.arrayToolsrfontTools.pens.filterPenr__all__rrr$rrr:s......555555 1 2GGGGG(GGG"G3G3G3G3G3G3r