
    ]Mh                     J    d dl mZ d dlmZ ddgZ G d de          Zd	dZdS )
    )pairwise)ContourFilterPenreversedContourReverseContourPenc                   *     e Zd ZdZd fd	Zd Z xZS )r   a  Filter 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.
    Fc                 X    t                                          |           || _        d S N)super__init__outputImpliedClosingLine)selfoutPenr   	__class__s      `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/fontTools/pens/reverseContourPen.pyr   zReverseContourPen.__init__   s)       (@%%%    c                 ,    t          || j                  S r	   )r   r   )r   contours     r   filterContourzReverseContourPen.filterContour   s    w(EFFFr   F)__name__
__module____qualname____doc__r   r   __classcell__)r   s   @r   r   r      sc         A A A A A AG G G G G G Gr   Fc           	   #     K   | sdS t          |           dk    s
J d            |                                 d         }|dv sJ |dk    }|                     d          \  }}|dv sJ d|z              |d	         }|d
k    rI|
J d            | r
J d            |d         ft          t          |dd	                             z   dz   }| s|dk    rd}nd}||fV  n| d	         \  }}|d	         }	|r||fV  ||	k    r'd|	ffV  |t          |dd	                   |fz   f| d	<   t          |           dk    r| d         \  }
}n||}}
|s0|
dk    r*||k    r$| d= | r|t          |dd	                   |z   f| d	<   n'||	ffV  |t          |dd	                   |fz   f| d	<   t	          | d          D ]=\  \  }}\  }}|t          t          |dd	                             |d	         fz   fV  >|rdnddfV  dS )zGenerator that takes a list of pen's (operator, operands) tuples,
    and yields them with the winding direction reversed.
    N   zinvalid contourr   )endPath	closePathr   )moveToqCurveToz invalid initial segment type: %rr    z)off-curve only paths must end with 'None'z,only one qCurveTo allowed per off-curve pathr	   r   FTlineTo)reverser    )lenpoptuplereversedr   )r   r   contourTypeclosed	firstTypefirstPtsfirstOnCurvelastTypelastPtslastOnCurve
secondType	secondPtscurTypecurPts_nextPtss                   r   r   r      s        w<<!. ++--"K22222K'F!++a..Ix....*Y6 /.. B<LJ##%P###JJJJJJQK>E(8AbD>*B*B$C$CCgM *I  FFF!!!!!#BK'bk 	LX%%%%{**....'wss|)<)<)NO7||a(/
%
II )1'I
+ R
 ))h).C.C
 R'/wss|1D1Dy1P&Q k^++++#U73B3<%8%8L?%JKGBK
 08/N/N/N 	I 	I+Wf|75&"+!6!67772;.HHHHHH
.++Y
222222r   Nr   )fontTools.misc.arrayToolsr   fontTools.pens.filterPenr   __all__r   r   r$   r   r   <module>r:      s    . . . . . . 5 5 5 5 5 5 1
2G G G G G( G G G"G3 G3 G3 G3 G3 G3r   