o
    tBh	                     @   s<   d dl mZ d dlmZ ddgZG dd deZdd ZdS )    )pairwise)ContourFilterPenreversedContourReverseContourPenc                   @   s   e Zd ZdZdd Zd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.
    c                 C   s   t |S N)r   )selfcontour r	   w/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/fontTools/pens/reverseContourPen.pyfilterContour   s   zReverseContourPen.filterContourN)__name__
__module____qualname____doc__r   r	   r	   r	   r
   r      s    c                 c   s   | sdS t | dksJ d|  d }|dv sJ |dk}| d\}}|dv s0J d| |d	 }|d
krW|du s@J d| rFJ d|d ftt|dd	  d }| sh|dkr`d}nd}||fV  n| d	 \}}|d	 }|r||fV  ||krd|ffV  |t|dd	 |f f| d	< t | dkr| d \}	}
n||}	}
|	dkr||
kr| d= | r|t|dd	 |
 f| d	< n||ffV  |t|dd	 |f f| d	< t| ddD ]\\}}\}}|tt|dd	 |d	 f fV  q|rd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   r	   )lenpoptuplereversedr   )r   contourTypeclosed	firstTypefirstPtsfirstOnCurvelastTypelastPtslastOnCurve
secondType	secondPtscurTypecurPts_nextPtsr	   r	   r
   r      sj   



&N)fontTools.misc.arrayToolsr   fontTools.pens.filterPenr   __all__r   r   r	   r	   r	   r
   <module>   s
    