+
    f7i2  c                   s    ^ RI t ^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RI
Ht  ! R R	]4      t ! R
 R]4      t ! R R4      tR# )    N)curve_to_quadraticcurves_to_quadratic)decomposeSuperBezierSegment)	FilterPen)ReverseContourPen)BasePointToSegmentPen)ReverseContourPointPenc                   sL   a a ] tR t^t oRtRV 3R lltV 3R ltR tRtVt	V ;t
# )Cu2QuPena  A filter pen to convert cubic bezier curves to quadratic b-splines
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 quadratic segments.
    all_quadratic: if True (default), only quadratic b-splines are generated.
        if False, quadratic curves or cubic curves are generated depending
        on which one is more economical.
c                sp   < V'       d   \        V4      p\        SV `	  V4       W n        W@n        WPn        R # N)r   super__init__max_errstatsall_quadratic)selfZ	other_penr   reverse_directionr   r   	__class__s   &&&&&&>/usr/lib64/python3.14/site-packages/fontTools/pens/cu2quPen.pyr   ZCu2QuPen.__init__)   s/     ))4I#
*    c                s  < V P                   WV3p\        W@P                  V P                  4      pV P                  eL   \        \        V4      ^,
          4      pV P                  P                  V^ 4      ^,           V P                  V&   V P                  '       d   V P                  ! VR,          !   R # \        V4      ^8X  d   V P                  ! VR,          !   R # \        V4      ^8X  g   Q h\        SV `(  ! VR,          !   R # )N   NN)
current_ptr   r   r   r   strlengetqCurveTor
   curveTo)r   Zpt1Zpt2Zpt3curveZresultnr   s   &&&&   r   _convert_curveZCu2QuPen._convert_curve8   s    #C0#E<<9K9KL::!CK!O$A JJNN1a014DJJqMMM6":&6{avbz*6{a''',r   c                s    \        V4      pV^8X  d   V P                  ! V!   R# V^8  d%   \        V4       F  pV P                  ! V!   K  	  R# V P                  ! V!   R# )i   N)r   r   r   r   )r   pointsr   Zsegments   &*  r   r   ZCu2QuPen.curveToG   sR    K6(U6v>##W- ? MM6"r   )r   r   r   FNT)__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes____classdictcell__Z__classcell__)r   __classdict__s   @@r   r   r      s      +-	# 	#r   r   c            	       s   a  ] tR t^St o RtR^]P                  3R^]P                  3R^]P                  3R^]P                  3/tRR lt	R t
R	 tR
 tR tRtV tR# )Cu2QuPointPena  A filter pen to convert cubic bezier curves to quadratic b-splines
using the FontTools PointPen protocol.

Args:
    other_point_pen: another PointPen 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: reverse the winding direction of all contours.
    stats: a dictionary counting the point numbers of quadratic segments.
    all_quadratic: if True (default), only quadratic b-splines are generated.
        if False, quadratic curves or cubic curves are generated depending
        on which one is more economical.
moveZlineqcurver   Nc                s    \         P                  ! V 4       V'       d   \        V4      V n        MWn        W n        W@n        WPn        R # r	   )r   r   r   penr   r   r   )r   Zother_point_penr   r   r   r   s   &&&&&&r   r   ZCu2QuPointPen.__init__j   s6     	&&t,-o>DH&H
*r   c           	     s   \        V4      ^8  g   Q hV^ ,          ^ ,          R8g  p. pVR,          ^,          pVR,          ^ ,          pV EFy  w  rgVR8X  EdJ   V P                  V4       EF0  pVR,          w  rrV^ ,          ^ ,          V^,          ^ ,          rW]W.p\        WP                  V P                  4      pV P
                  eL   \        \        V4      ^,
          4      pV P
                  P                  V^ 4      ^,           V P
                  V&   V^R  Uu. uF	  pVRR/ 3NK  	  ppVP                  WW34       V P                  '       g   \        V4      ^8X  d   VP                  RV.4       MVP                  RV.4       VR,          ^ ,          pEK3  	  EKW  VP                  Wg.4       VR,          ^ ,          pEK|  	  V'       d   VRR VRR ,           pV P                  V4       R# u upi )r   r*   r   NFr+   )
r   _split_super_bezier_segmentsr   r   r   r   r   r   append_drawPoints)r   segmentsZclosedZnew_segmentsZprev_pointsZprev_on_curvesegment_typer   
sub_pointson_curvesmoothnamekwargsZbcp1Zbcp2ZcubicZquadr   ptZ
new_pointss   &&                  r   _flushContourZCu2QuPointPen._flushContour{   s   8}!!!!Q6)rl1o#B*$, Lw&"&"C"CF"KJ5?^2Hd!+Aq!1:a=3C$*$AE-e\\4CUCUVDzz-D	A.(,

q!(<q(@

1BFq*!M*B2udB"7*J!M%%x&FG)))S_-A$++Xz,BC$++Wj,AB$.rN1$5M #L  ##\$:; &r
1' %-(  (,|CR/@@L& "Ns   G2c                s   . p\        V4      ^,
          pV^8X  d   VP                  V4       V# V^8  d   VR,          w  rErgV^,
          p\        \        V U	U
u. uF	  w  p	  qNK  	  up
p	4      4       Fv  w  r. pVRR  F  pVP                  VRR/ 34       K  	  W^,
          8X  d   VP                  WEWg34       MVP                  VR,          RR/ 34       VP                  V4       Kx  	  V# \	        RV,          4      hu up
p	i )r   NFTz$expected 2 control points, found: %dr-   )r   r/   	enumerater   AssertionError)r   r   Zsub_segmentsr   r4   r5   r6   r7   Znum_sub_segmentsr8   Z_ir3   Znew_segmentZpoint   &&             r   r.   Z*Cu2QuPointPen._split_super_bezier_segments   s   K!O6'( ' U-3BZ*Hd 1u!*+6,J6KB1aR6,JK" !'_E&&udB'?@ -A-.&&$'GH  &&
2dB'GH##K0"  !!G!!KLL -Ks   Dc           
     sP   V P                   pVP                  4        . pV P                  p\        V4       F  w  pw  rgWd9   d   WF,          w  rV	! \	        V4      V4      '       g   Q R V: RV R\	        V4       24       hVRR p
V^ 8X  d   T
pM!V
 F  w  rrVP
                  ! VRW3/ VB  K  	  VR,          w  rrVf   VR8X  g   Q hK  VP
                  ! WW3/ VB  K  \        RV,          4      h	  V F  w  rrVP
                  ! VRW3/ VB  K  	  VP                  4        R# )zillegal z segment point count: expected z, got Nr+   zunexpected segment type: %rr-   )r,   Z	beginPath_Cu2QuPointPen__points_requiredr:   r   ZaddPointr;   endPath)r   r1   r,   Zlast_offcurvesZpoints_requiredr<   r2   r   r   ZopZ	offcurvesr8   r5   r6   r7   r=   r   r0   ZCu2QuPointPen._drawPoints   sB   hh00)28)<%A%.'5#f+q)) |. /  !s&V7) #3BK	6 &/N4=0DRvFvF 5>+1":(D:'8333 LL6J6J$%B\%QRR3 *=4 )7$BLLT6:6: )7r   c                s\    V P                   e   Q hV P                  P                  W4       R # r	   )ZcurrentPathr,   addComponent)r   ZbaseGlyphNameZtransformations   &&&r   r@   ZCu2QuPointPen.addComponent   s&    '''m<r   )r   r   r,   r   r    )r!   r"   r#   r$   r%   operatorZeqZger>   r   r9   r.   r0   r@   r&   r'   r(      @r   r)   r)   S   sl       	HKK HKK 1hkk"!X[[!	+"'B8!F= =r   r)   c                   sp   a  ] tR t^t o RtRR ltR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )Cu2QuMultiPena  A filter multi-pen to convert cubic bezier curves to quadratic b-splines
in a interpolation-compatible manner, using the FontTools SegmentPen protocol.

Args:

    other_pens: list of SegmentPens used to draw the transformed outlines.
    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.

This pen does not follow the normal SegmentPen protocol. Instead, its
moveTo/lineTo/qCurveTo/curveTo methods take a list of tuples that are
arguments that would normally be passed to a SegmentPen, one item for
each of the pens in other_pens.
c                s    V'       d   V Uu. uF  p\        VR R7      NK  	  ppWn        W n        RV n        RV n        R# u upi )T)ZoutputImpliedClosingLineN)r   pensr   	start_ptscurrent_pts)r   Z
other_pensr   r   r,   s   &&&& r   r   ZCu2QuMultiPen.__init__   sN     &%C "#E%   	s   Ac                s8    V P                   f   \        R4      hR # )NzmoveTo is requiredrG   r;   r      &r   _check_contour_is_openZ$Cu2QuMultiPen._check_contour_is_open   s    # !566 $r   c                s8    V P                   e   \        R4      hR # )Nz closePath or endPath is requiredrH   rI   rJ   r   _check_contour_is_closedZ&Cu2QuMultiPen._check_contour_is_closed  s    ' !CDD (r   c                s    V P                   eC   \        V P                   V P                  4       F  w  rVP                  ! V!   K  	  R V n         R # R # r	   )rF   ziprE   moveTo)r   r8   r,   s   &  r   _add_moveToZCu2QuMultiPen._add_moveTo  s>    >>%t~~tyy9

B :!DN &r   c                sb    V P                  4        V;V n        V n        V P                  4        R # r	   )rL   rF   rG   rO   )r   pts   &&r   rN   ZCu2QuMultiPen.moveTo  s)    %%',//)r   c                s    V P                  4        V P                  4        \        WP                  4       F  w  r#VP                  ! V!   K  	  Wn        R # r	   )rK   rO   rM   rE   lineTorG   )r   rP   r8   r,   s   &&  r   rR   ZCu2QuMultiPen.lineTo  s@    ##%3		*GBJJO +r   c                sp   V P                  4        \        V^ ,          4      ^8X  d+   T P                  V Uu. uF  q"^ ,          3NK  	  up4       R# V P                  4        . p\	        WP
                  4       F.  w  r$VP                  ! V!   VP                  VR,          34       K0  	  W0n        R# u upi )r    Nr-   )	rK   r   rR   rO   rM   rE   r   r/   rG   )r   
pointsListr   rG   r,   s   &&   r   r   ZCu2QuMultiPen.qCurveTo  s    ##%z!}"KKJ?J&)J?@z995KFLL&!r
}- 6 ' @s   B3c                s*   . p\        V P                  V4       F  w  r4VP                  W4,           4       K  	  \        W P                  .\        V4      ,          4      p. pV F  pVP                  VR ,          4       K  	  V P                  V4       R# )r   N)rM   rG   r/   r   r   r   r   )r   rS   Zcurvesr   r   Z
quadraticsZ	quadratics   &&     r   _curves_to_quadraticZ"Cu2QuMultiPen._curves_to_quadratic&  sw    "%d&6&6
"CJMM*-. #D(,,#f+1MN

#Iim, $j!r   c                sH    V P                  4        V P                  V4       R # r	   )rK   rT   )r   rS   rQ   r   r   ZCu2QuMultiPen.curveTo0  s    ##%!!*-r   c                    V P                  4        V P                  f$   V P                   F  pVP                  4        K  	  R ;V n        V n        R # r	   )rK   rF   rE   	closePathrG   r   r,      & r   rV   ZCu2QuMultiPen.closePath4  s>    ##%>>!yy !,004>r   c                rU   r	   )rK   rF   rE   r?   rG   rW   rX   r   r?   ZCu2QuMultiPen.endPath;  s>    ##%>>!yy !,004>r   c                s    V P                  4        \        W P                  4       F  w  r4VP                  W4       K  	  R # r	   )rL   rM   rE   r@   )r   Z	glyphNameZtransformationsZtransr,   s   &&&  r   r@   ZCu2QuMultiPen.addComponentB  s1    %%'oyy9JEY. :r   )rG   r   rE   rF   N)F)r!   r"   r#   r$   r%   r   rK   rL   rO   rN   rR   r   rT   r   rV   r?   r@   r&   r'   rB   rC   r   rD   rD      sL     (	 7E"

'".11/ /r   rD   )rA   ZfontTools.cu2qur   r   ZfontTools.pens.basePenr   ZfontTools.pens.filterPenr   Z fontTools.pens.reverseContourPenr   ZfontTools.pens.pointPenr   r   r   r)   rD   ) r   r   <module>rY      sE     C > . > 9 :8#y 8#vJ=) J=Ze/ e/r   