Ë
    £eh‘  ã                   óF   — d dl mZ d dlmZ d dlmZ d dlZ G d„ de«      Zy)é    )Úquadratic_to_curves)ÚContourFilterPen)ÚReverseContourPenNc                   ó6   ‡ — e Zd ZdZ	 	 	 dˆ fd„	Zd„ Zd„ Zˆ xZS )ÚQu2CuPena5  A filter pen to convert quadratic bezier splines to cubic curves
    using the FontTools SegmentPen protocol.

    Args:

        other_pen: another SegmentPen used to draw the transformed outline.
        max_err: maximum approximation error in font units. For optimal results,
            if you know the UPEM of the font, we recommend setting this to a
            value equal, or close to UPEM / 1000.
        reverse_direction: flip the contours' direction but keep starting point.
        stats: a dictionary counting the point numbers of cubic segments.
    c                 óh   •— |rt        |«      }t        ‰| �	  |«       || _        || _        || _        y )N)r   ÚsuperÚ__init__Ú	all_cubicÚmax_errÚstats)ÚselfÚ	other_penr   r   Úreverse_directionr   Ú	__class__s         €úU/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/fontTools/pens/qu2cuPen.pyr
   zQu2CuPen.__init__$   s4   ø€ ñ Ü)¨)Ó4ˆIÜ‰Ñ˜Ô#Ø"ˆŒØˆŒØˆ�
ó    c              #   óL  K  — t        || j                  | j                  ¬«      }| j                  �J|D ]E  }t	        t        |«      dz
  «      }| j                  j                  |d«      dz   | j                  |<   ŒG |D ]#  }t        |«      dk(  r
d|dd  f–— Œd|dd  f–— Œ% y ­w)N)r   é   r   é   é   ÚcurveToÚqCurveTo)r   r   r   r   ÚstrÚlenÚget)r   ÚqÚcurvesÚcurveÚns        r   Ú_quadratics_to_curvezQu2CuPen._quadratics_to_curve3   s¦   è ø€ Ü$ Q¨¯©ÀÇÁÔOˆØ�:‰:Ð!Øò 9�Üœ˜E›
 Q™Ó'�Ø $§
¡
§¡¨q°!Ó 4°qÑ 8�—
‘
˜1’ð9ð ò 	.ˆEÜ�5‹z˜QŠØ  %¨¨ )Ð,Ó,à! 5¨¨ 9Ð-Ó-ñ		.ùs   ‚B"B$c                 ó  — g }d }g }|D ]�  \  }}|dk(  rE| j                   st        |«      dkD  r+|d   �&|d   €t        d«      ‚|j                  |f|z   «       n7|r"|j	                  | j                  |«      «       g }|j                  ||f«       |r|d   nd }Œ‘ |r |j	                  | j                  |«      «       | j                   s¶|}g }|D ]­  \  }}|dk(  r�|rŽ|d   d   dk(  rƒ|d   d   d   }|d   d   d   }|d   }	|�ft        j                  |	d   |d   z
  |d   |d   z
  «      r>t        j                  |	d   |d   z
  |d   |d   z
  «      r|d   d   d d |z   }
||
f|d<   Œ›|j                  ||f«       Œ¯ |S )Nr   r   éÿÿÿÿz4oncurve-less contours with all_cubic not implementedr   r   éþÿÿÿ)r   r   ÚNotImplementedErrorÚappendÚextendr!   ÚmathÚisclose)r   ÚcontourÚ
quadraticsÚ	currentPtÚ
newContourÚopÚargsÚpt0Úpt1Úpt2ÚnewArgss              r   ÚfilterContourzQu2CuPen.filterContour?   s×  € Øˆ
Øˆ	Øˆ
Øò 	3‰HˆB�Ø�ZÒØ—’¤3 t£9¨q¢=°T¸"±XÐ5Ià˜‘8Ð#Ü-ØNóð ð ×!Ñ! 9 ,°Ñ"5Õ6áØ×%Ñ% d×&?Ñ&?À
Ó&KÔLØ!#�JØ×!Ñ! 2 t *Ô-Ù$(˜˜Rš¨d‰Ið	3ñ Ø×Ñ˜d×7Ñ7¸
ÓCÔDà�~Š~à ˆGØˆJØ#ò .‘��DØ˜Ò#©
°zÀ"±~ÀaÑ7HÈJÒ7VØ$ R™.¨Ñ+¨BÑ/�CØ$ R™.¨Ñ+¨BÑ/�CØ˜q™'�Cà˜Ü ŸL™L¨¨Q©°#°a±&©¸#¸a¹&À3ÀqÁ6¹/ÔJÜ ŸL™L¨¨Q©°#°a±&©¸#¸a¹&À3ÀqÁ6¹/ÔJà",¨R¡.°Ñ"3°C°RÐ"8¸4Ñ"?˜Ø*,¨g¨˜
 2™Ø à×!Ñ! 2 t *Õ-ð.ð  Ðr   )FFN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r!   r4   Ú__classcell__)r   s   @r   r   r      s"   ø„ ñð" ØØõò
.ö*r   r   )ÚfontTools.qu2cur   ÚfontTools.pens.filterPenr   Ú fontTools.pens.reverseContourPenr   r(   r   © r   r   ú<module>r>      s"   ðõ  0Ý 5Ý >Û ôSÐõ Sr   