+
    f7i0  c                   sx   R t ^ RIHtHt ^ RIHtHt . ROtR t ! R R]4      t	 ! R	 R]]	4      t
 ! R
 R]4      t ! R R]]4      tRR lt]R8X  dg   ]	! 4       t]P!                  R4       ]P#                  R4       ]P%                  RRR4       ]P'                  4        ^ RIHt ]! ]P*                  4       R# R# )z:Pen recording operations that can be accessed or replayed.)AbstractPenDecomposingPen)AbstractPointPenDecomposingPointPenRecordingPenDecomposingRecordingPenDecomposingRecordingPointPenRecordingPointPenc                s:    V  F  w  r#\        W4      ! V!   K  	  R# )a  Replay a recording, as produced by RecordingPen or DecomposingRecordingPen,
to a pen.

Note that recording does not have to be produced by those pens.
It can be any iterable of tuples of method name and tuple-of-arguments.
Likewise, pen can be any objects receiving those method calls.
N)getattr)Z	recordingpenoperatorZoperandss   &&  B/usr/lib64/python3.14/site-packages/fontTools/pens/recordingPen.pyreplayRecordingr      s     () (    c                   sd   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
 tR t]tRtV tR# )r   a  Pen recording operations that can be accessed or replayed.

The recording can be accessed as pen.value; or replayed using
pen.replay(otherPen).

:Example:
    .. code-block::

        from fontTools.ttLib import TTFont
        from fontTools.pens.recordingPen import RecordingPen

        glyph_name = 'dollar'
        font_path = 'MyFont.otf'

        font = TTFont(font_path)
        glyphset = font.getGlyphSet()
        glyph = glyphset[glyph_name]

        pen = RecordingPen()
        glyph.draw(pen)
        print(pen.value)
c                    . V n         R # Nvalueself   &r   __init__ZRecordingPen.__init__5   	    
r   c                B    V P                   P                  R V334       R# )moveToNr   Zappend)r   Zp0   &&r   r   ZRecordingPen.moveTo8       

8bU+,r   c                r   )lineToNr   )r   Zp1r   r   r   ZRecordingPen.lineTo;   r   r   c                @    V P                   P                  R V34       R# )qCurveToNr   r   Zpoints   &*r   r   ZRecordingPen.qCurveTo>   s    

:v./r   c                r   )curveToNr   r   r    r   r!   ZRecordingPen.curveToA   s    

9f-.r   c                <    V P                   P                  R4       R# )	closePathN)r#    r   r   r   r   r#   ZRecordingPen.closePathD   s    

+,r   c                r"   )endPathN)r%   r$   r   r   r   r   r%   ZRecordingPen.endPathG   s    

/*r   c                sB    V P                   P                  R W334       R# )addComponentNr   )r   	glyphNametransformations   &&&r   r&   ZRecordingPen.addComponentJ   s    

>I+FGHr   c                sD    V P                   P                  R WV334       R# )addVarComponentNr   )r   r'   r(   locations   &&&&r   r)   ZRecordingPen.addVarComponentM   s    

,y(.STUr   c                s2    \        V P                  V4       R # r   )r   r   )r   r	   r   r   replayZRecordingPen.replayP   s    

C(r   r   N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r!   r#   r%   r&   r)   r+   Zdraw__static_attributes____classdictcell__Z__classdict__   @r   r   r      sE     .--0/-+IV) Dr   c                   s    ] tR t^VtRtRtRtR# )r   a  Same as RecordingPen, except that it doesn't keep components
as references, but draws them decomposed as regular contours.

The constructor takes a required 'glyphSet' positional argument,
a dictionary of glyph objects (i.e. with a 'draw' method) keyed
by thir name; other arguments are forwarded to the DecomposingPen's
constructor::

    >>> class SimpleGlyph(object):
    ...     def draw(self, pen):
    ...         pen.moveTo((0, 0))
    ...         pen.curveTo((1, 1), (2, 2), (3, 3))
    ...         pen.closePath()
    >>> class CompositeGlyph(object):
    ...     def draw(self, pen):
    ...         pen.addComponent('a', (1, 0, 0, 1, -1, 1))
    >>> class MissingComponent(object):
    ...     def draw(self, pen):
    ...         pen.addComponent('foobar', (1, 0, 0, 1, 0, 0))
    >>> class FlippedComponent(object):
    ...     def draw(self, pen):
    ...         pen.addComponent('a', (-1, 0, 0, 1, 0, 0))
    >>> glyphSet = {
    ...    'a': SimpleGlyph(),
    ...    'b': CompositeGlyph(),
    ...    'c': MissingComponent(),
    ...    'd': FlippedComponent(),
    ... }
    >>> for name, glyph in sorted(glyphSet.items()):
    ...     pen = DecomposingRecordingPen(glyphSet)
    ...     try:
    ...         glyph.draw(pen)
    ...     except pen.MissingComponentError:
    ...         pass
    ...     print("{}: {}".format(name, pen.value))
    a: [('moveTo', ((0, 0),)), ('curveTo', ((1, 1), (2, 2), (3, 3))), ('closePath', ())]
    b: [('moveTo', ((-1, 1),)), ('curveTo', ((0, 2), (1, 3), (2, 4))), ('closePath', ())]
    c: []
    d: [('moveTo', ((0, 0),)), ('curveTo', ((-1, 1), (-2, 2), (-3, 3))), ('closePath', ())]

    >>> for name, glyph in sorted(glyphSet.items()):
    ...     pen = DecomposingRecordingPen(
    ...         glyphSet, skipMissingComponents=True, reverseFlipped=True,
    ...     )
    ...     glyph.draw(pen)
    ...     print("{}: {}".format(name, pen.value))
    a: [('moveTo', ((0, 0),)), ('curveTo', ((1, 1), (2, 2), (3, 3))), ('closePath', ())]
    b: [('moveTo', ((-1, 1),)), ('curveTo', ((0, 2), (1, 3), (2, 4))), ('closePath', ())]
    c: []
    d: [('moveTo', ((0, 0),)), ('lineTo', ((-3, 3),)), ('curveTo', ((-2, 2), (-1, 1), (0, 0))), ('closePath', ())]
Fr$   Nr,   r-   r.   r/   r0   ZskipMissingComponentsr1   r$   r   r   r   r   V   s    2j "r   c                   sb   a  ] tR t^t o RtR tRR ltR tRR ltRR lt	RR lt
R	 t]tR
tV tR# )r   aK  PointPen recording operations that can be accessed or replayed.

The recording can be accessed as pen.value; or replayed using
pointPen.replay(otherPointPen).

:Example:
    .. code-block::

        from defcon import Font
        from fontTools.pens.recordingPen import RecordingPointPen

        glyph_name = 'a'
        font_path = 'MyFont.ufo'

        font = Font(font_path)
        glyph = font[glyph_name]

        pen = RecordingPointPen()
        glyph.drawPoints(pen)
        print(pen.value)

        new_glyph = font.newGlyph('b')
        pen.replay(new_glyph.getPointPen())
c                r   r   r   r   r   r   r   ZRecordingPointPen.__init__   r   r   Nc                sR    Ve   WR&   V P                   P                  RRV34       R # )N
identifier	beginPathr$   r   )r   r6   kwargss   &&,r   r7   ZRecordingPointPen.beginPath   s)    !#-< 

;F34r   c                sB    V P                   P                  R R/ 34       R# )r%   Nr$   r   r   r   r   r%   ZRecordingPointPen.endPath   s    

9b"-.r   c                sV    Ve   WVR&   V P                   P                  RWW43V34       R # )Nr6   addPointr   )r   ZptZsegmentTypeZsmoothZnamer6   r8   s   &&&&&&,r   r9   ZRecordingPointPen.addPoint   s0     !#-< 

:'FOPr   c                sT    Ve   W4R&   V P                   P                  RW3V34       R # )Nr6   r&   r   )r   baseGlyphNamer(   r6   r8   s   &&&&,r   r&   ZRecordingPointPen.addComponent   s,    !#-< 

>M+JFSTr   c                sV    Ve   WER&   V P                   P                  RWV3V34       R # )Nr6   r)   r   )r   r:   r(   r*   r6   r8   s   &&&&&,r   r)   Z!RecordingPointPen.addVarComponent   s3     !#-< 

 I6R	
r   c                sT    V P                    F  w  r#p\        W4      ! V/ VB  K  	  R # r   )r   r   )r   ZpointPenr
   Zargsr8   s   &&   r   r+   ZRecordingPointPen.replay   s'    &*jj"HFH'88 '1r   r   r   )NFNN)r,   r-   r.   r/   r0   r   r7   r%   r9   r&   r)   r+   Z
drawPointsr1   r2   r3   r4   r   r   r      s6     25
/QU

9 Jr   c                   s    ] tR t^tRtRtRtR# )r   ab  Same as RecordingPointPen, except that it doesn't keep components
as references, but draws them decomposed as regular contours.

The constructor takes a required 'glyphSet' positional argument,
a dictionary of pointPen-drawable glyph objects (i.e. with a 'drawPoints' method)
keyed by thir name; other arguments are forwarded to the DecomposingPointPen's
constructor::

    >>> from pprint import pprint
    >>> class SimpleGlyph(object):
    ...     def drawPoints(self, pen):
    ...         pen.beginPath()
    ...         pen.addPoint((0, 0), "line")
    ...         pen.addPoint((1, 1))
    ...         pen.addPoint((2, 2))
    ...         pen.addPoint((3, 3), "curve")
    ...         pen.endPath()
    >>> class CompositeGlyph(object):
    ...     def drawPoints(self, pen):
    ...         pen.addComponent('a', (1, 0, 0, 1, -1, 1))
    >>> class MissingComponent(object):
    ...     def drawPoints(self, pen):
    ...         pen.addComponent('foobar', (1, 0, 0, 1, 0, 0))
    >>> class FlippedComponent(object):
    ...     def drawPoints(self, pen):
    ...         pen.addComponent('a', (-1, 0, 0, 1, 0, 0))
    >>> glyphSet = {
    ...    'a': SimpleGlyph(),
    ...    'b': CompositeGlyph(),
    ...    'c': MissingComponent(),
    ...    'd': FlippedComponent(),
    ... }
    >>> for name, glyph in sorted(glyphSet.items()):
    ...     pen = DecomposingRecordingPointPen(glyphSet)
    ...     try:
    ...         glyph.drawPoints(pen)
    ...     except pen.MissingComponentError:
    ...         pass
    ...     pprint({name: pen.value})
    {'a': [('beginPath', (), {}),
           ('addPoint', ((0, 0), 'line', False, None), {}),
           ('addPoint', ((1, 1), None, False, None), {}),
           ('addPoint', ((2, 2), None, False, None), {}),
           ('addPoint', ((3, 3), 'curve', False, None), {}),
           ('endPath', (), {})]}
    {'b': [('beginPath', (), {}),
           ('addPoint', ((-1, 1), 'line', False, None), {}),
           ('addPoint', ((0, 2), None, False, None), {}),
           ('addPoint', ((1, 3), None, False, None), {}),
           ('addPoint', ((2, 4), 'curve', False, None), {}),
           ('endPath', (), {})]}
    {'c': []}
    {'d': [('beginPath', (), {}),
           ('addPoint', ((0, 0), 'line', False, None), {}),
           ('addPoint', ((-1, 1), None, False, None), {}),
           ('addPoint', ((-2, 2), None, False, None), {}),
           ('addPoint', ((-3, 3), 'curve', False, None), {}),
           ('endPath', (), {})]}

    >>> for name, glyph in sorted(glyphSet.items()):
    ...     pen = DecomposingRecordingPointPen(
    ...         glyphSet, skipMissingComponents=True, reverseFlipped=True,
    ...     )
    ...     glyph.drawPoints(pen)
    ...     pprint({name: pen.value})
    {'a': [('beginPath', (), {}),
           ('addPoint', ((0, 0), 'line', False, None), {}),
           ('addPoint', ((1, 1), None, False, None), {}),
           ('addPoint', ((2, 2), None, False, None), {}),
           ('addPoint', ((3, 3), 'curve', False, None), {}),
           ('endPath', (), {})]}
    {'b': [('beginPath', (), {}),
           ('addPoint', ((-1, 1), 'line', False, None), {}),
           ('addPoint', ((0, 2), None, False, None), {}),
           ('addPoint', ((1, 3), None, False, None), {}),
           ('addPoint', ((2, 4), 'curve', False, None), {}),
           ('endPath', (), {})]}
    {'c': []}
    {'d': [('beginPath', (), {}),
           ('addPoint', ((0, 0), 'curve', False, None), {}),
           ('addPoint', ((-3, 3), 'line', False, None), {}),
           ('addPoint', ((-2, 2), None, False, None), {}),
           ('addPoint', ((-1, 1), None, False, None), {}),
           ('endPath', (), {})]}
Fr$   Nr5   r$   r   r   r   r      s    Tn "r   c              #  s  "   \        V 4      \        V4      8w  d'   \        R\        V 4      \        V4      3,          4      h\        W4       F  w  w  r4w  rVW58w  d   \        RV: RV: 24      hVR8X  d   \        R4      h\        WF4       UUU	U
u. uF6  w  w  rxw  rWyV,
          V,          ,           WV,
          V,          ,           3NK8  	  pp	ppp
W;3x  K  	  R# u up
p	ppi 5i)a  Linearly interpolate between two recordings. The recordings
must be decomposed, i.e. they must not contain any components.

Factor is typically between 0 and 1. 0 means the first recording,
1 means the second recording, and 0.5 means the average of the
two recordings. Other values are possible, and can be useful to
extrapolate. Defaults to 0.5.

Returns a generator with the new recording.
zMismatched lengths: %d and %dzMismatched operations: z, r&   zCannot interpolate componentsN)ZlenZ
ValueErrorZzip)Z
recording1Z
recording2ZfactorZop1Zargs1Zop2Zargs2Zx1Zy1Zx2Zy2Zmid_argss   &&&         r   lerpRecordingsr;   +  s      :#j/)+s:J.PP
 	
 '**&A"ls:SIJJ. <== +.e*;*;&HRhr Bw&(("R6/A*AB*;   o 'Bs   BC&<CC&Z__main__)pprintN)r   r   r   r   r   r;   )g      ?)    r=   )r=   id   )2   iK   )i<   r>   )r>   i   )r0   ZfontTools.pens.basePenr    r   ZfontTools.pens.pointPenr   r   Z__all__r   r   r   r   r   r;   r,   r	   r   r   r!   r#   r<   r   r$   r   r   <module>r?      s    @ > I	*6; 6r6"nl 6"r>( >BX"#68I X"v8 z
.CJJvJJxKK(H-MMO
399 r   