
    Mcg                     
   d dl mZmZ ddgZ G d de      Z G d de      Zedk(  r\d dlmZ  e ed      d	      Z	e	j                  d
       e	j                  d       e	j                  dddd
       e	j                          yy)    )	FilterPenFilterPointPenTransformPenTransformPointPenc                   R     e Zd ZdZ fdZd Zd Zd Zd Zd Z	d Z
d	 Zd
 Z xZS )r   zkPen that transforms all coordinates using a Affine transformation,
    and passes them to another pen.
    c                     t         t        |   |       t        |d      sddlm}  || }|| _        |j                  | _        g | _	        y)zThe 'outPen' argument is another pen object. It will receive the
        transformed coordinates. The 'transformation' argument can either
        be a six-tuple, or a fontTools.misc.transform.Transform object.
        transformPointr   	TransformN)
superr   __init__hasattrfontTools.misc.transformr   _transformationr	   _transformPoint_stack)selfoutPentransformationr   	__class__s       V/var/www/html/bid-api/venv/lib/python3.12/site-packages/fontTools/pens/transformPen.pyr   zTransformPen.__init__   sI    
 	lD*62~'78:&7N--<<    c                 X    | j                   j                  | j                  |             y N)_outPenmoveTor   r   pts     r   r   zTransformPen.moveTo       D0045r   c                 X    | j                   j                  | j                  |             y r   )r   lineTor   r   s     r   r!   zTransformPen.lineTo   r   r   c                 T     | j                   j                  | j                  |        y r   )r   curveTo_transformPointsr   pointss     r   r#   zTransformPen.curveTo    s!    d33F;<r   c                     |d   | j                  |d d       d gz   }n| j                  |      } | j                  j                  |  y )N)r$   r   qCurveTor%   s     r   r)   zTransformPen.qCurveTo#   sM    ":**6#2;74&@F**62Fv&r   c                 P    | j                   }|D cg c]
  } ||       c}S c c}w r   )r   )r   r&   r	   r   s       r   r$   zTransformPen._transformPoints*   s*    ---34Vrr"V444s   #c                 8    | j                   j                          y r   )r   	closePathr   s    r   r,   zTransformPen.closePath.   s     r   c                 8    | j                   j                          y r   )r   endPathr-   s    r   r/   zTransformPen.endPath1   s    r   c                 r    | j                   j                  |      }| j                  j                  ||       y r   r   	transformr   addComponent)r   	glyphNamer   s      r   r3   zTransformPen.addComponent4   s,    --77G!!)^<r   )__name__
__module____qualname____doc__r   r   r!   r#   r)   r$   r,   r/   r3   __classcell__r   s   @r   r   r      s5    66='5!=r   c                   0     e Zd ZdZ fdZddZd Z xZS )r   a^  PointPen that transforms all coordinates using a Affine transformation,
    and passes them to another PointPen.

    For example::

        >>> from fontTools.pens.recordingPen import RecordingPointPen
        >>> rec = RecordingPointPen()
        >>> pen = TransformPointPen(rec, (2, 0, 0, 2, -10, 5))
        >>> v = iter(rec.value)
        >>> pen.beginPath(identifier="contour-0")
        >>> next(v)
        ('beginPath', (), {'identifier': 'contour-0'})

        >>> pen.addPoint((100, 100), "line")
        >>> next(v)
        ('addPoint', ((190, 205), 'line', False, None), {})

        >>> pen.endPath()
        >>> next(v)
        ('endPath', (), {})

        >>> pen.addComponent("a", (1, 0, 0, 1, -10, 5), identifier="component-0")
        >>> next(v)
        ('addComponent', ('a', <Transform [2 0 0 2 -30 15]>), {'identifier': 'component-0'})
    c                     t         |   |       t        |d      sddlm}  || }|| _        |j                  | _        y)zThe 'outPointPen' argument is another point pen object.
        It will receive the transformed coordinates.
        The 'transformation' argument can either be a six-tuple, or a
        fontTools.misc.transform.Transform object.
        r	   r   r
   N)r   r   r   r   r   r   r	   r   )r   outPointPenr   r   r   s       r   r   zTransformPointPen.__init__T   s@     	%~'78:&7N--<<r   c                 b     | j                   j                  | j                  |      |||fi | y r   )r   addPointr   )r   r   segmentTypesmoothnamekwargss         r   r?   zTransformPointPen.addPointb   s2      $k64	
CI	
r   c                 v    | j                   j                  |      } | j                  j                  ||fi | y r   r1   )r   baseGlyphNamer   rC   s       r   r3   zTransformPointPen.addComponentg   s3    --77G!!!-J6Jr   )NFN)r5   r6   r7   r8   r   r?   r3   r9   r:   s   @r   r   r   9   s    4=

Kr   __main__)_TestPenN)   r   g      ?rH   ir   )r   r   )r   d   )2   K   )<   rJ   )rJ      )fontTools.pens.filterPenr   r   __all__r   r   r5   fontTools.pens.basePenrG   penr   r!   r#   r,    r   r   <module>rS      s    > .
//=9 /=d0K 0Kf z/
x~'=
>CJJvJJxKK(Hf5MMO r   