+
    f7i  c                   sf    ^ RI HtHt ^ RIHt ^ RIHtHt RR.t ! R R]4      t	 ! R R]4      t
R# )	    )noRoundotRound)	Transform)	FilterPenFilterPointPenRoundingPenRoundingPointPenc                   s\   a a ] tR t^	t oRt]]3V 3R lltR tR t	R t
R tR tRtVtV ;t# )	r   a  
Filter pen that rounds point coordinates and component XY offsets to integer. For
rounding the component transform values, a separate round function can be passed to
the pen.

>>> from fontTools.pens.recordingPen import RecordingPen
>>> recpen = RecordingPen()
>>> roundpen = RoundingPen(recpen)
>>> roundpen.moveTo((0.4, 0.6))
>>> roundpen.lineTo((1.6, 2.5))
>>> roundpen.qCurveTo((2.4, 4.6), (3.3, 5.7), (4.9, 6.1))
>>> roundpen.curveTo((6.4, 8.6), (7.3, 9.7), (8.9, 10.1))
>>> roundpen.addComponent("a", (1.5, 0, 0, 1.5, 10.5, -10.5))
>>> recpen.value == [
...     ('moveTo', ((0, 1),)),
...     ('lineTo', ((2, 3),)),
...     ('qCurveTo', ((2, 5), (3, 6), (5, 6))),
...     ('curveTo', ((6, 9), (7, 10), (9, 10))),
...     ('addComponent', ('a', (1.5, 0, 0, 1.5, 11, -10))),
... ]
True
c                >   < \         SV `  V4       W n        W0n        R # NZsuper__init__	roundFunctransformRoundFuncselfZoutPenr   r   	__class__   &&&&A/usr/lib64/python3.14/site-packages/fontTools/pens/roundingPen.pyr   ZRoundingPen.__init__!        ""4    c                    V P                   P                  V P                  V^ ,          4      V P                  V^,          4      34       R# r    N)_outPenmoveTor   r   pt   &&r   r   ZRoundingPen.moveTo&   3    T^^BqE2DNN2a54IJKr   c                r   r   )r   lineTor   r   r   r   r   ZRoundingPen.lineTo)   r   r   c                P   a  S P                   P                  ! V 3R  lV 4       !   R# )c              3   l   <"   T F)  w  rSP                  V4      SP                  V4      3x  K+  	  R # 5ir	   r   Z.0ZxZyr      &  r   	<genexpr>Z&RoundingPen.curveTo.<locals>.<genexpr>.   *     Ht~~a $.."34   14N)r   curveTor   Zpoints   f*r   r&   ZRoundingPen.curveTo,   s    HH	
r   c                r   )c              3   r   r	   r    r!   r"   r   r#   Z'RoundingPen.qCurveTo.<locals>.<genexpr>3   r$   r%   N)r   qCurveTor'   r(   r   r)   ZRoundingPen.qCurveTo1   s    HH	
r   c                s   Vw  r4rVrxV P                   P                  V\        V P                  V4      V P                  V4      V P                  V4      V P                  V4      V P	                  V4      V P	                  V4      4      4       R # r	   r   addComponentr   r   r   )	r   Z	glyphNametransformationxxxyyxyydxdys	   &&&      r   r+   ZRoundingPen.addComponent6   s{    !/!!''+''+''+''+r"r"
	
r   r   r   )__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r&   r)   r+   __static_attributes____classdictcell____classcell__r   Z__classdict__   @@r   r   r   	   s6     . *1W 5
LL




 
r   c                   sR   a a ] tR t^Et oRt]]3V 3R lltRR ltRR lt	Rt
VtV ;t# )r   a$  
Filter point pen that rounds point coordinates and component XY offsets to integer.
For rounding the component scale values, a separate round function can be passed to
the pen.

>>> from fontTools.pens.recordingPen import RecordingPointPen
>>> recpen = RecordingPointPen()
>>> roundpen = RoundingPointPen(recpen)
>>> roundpen.beginPath()
>>> roundpen.addPoint((0.4, 0.6), 'line')
>>> roundpen.addPoint((1.6, 2.5), 'line')
>>> roundpen.addPoint((2.4, 4.6))
>>> roundpen.addPoint((3.3, 5.7))
>>> roundpen.addPoint((4.9, 6.1), 'qcurve')
>>> roundpen.endPath()
>>> roundpen.addComponent("a", (1.5, 0, 0, 1.5, 10.5, -10.5))
>>> recpen.value == [
...     ('beginPath', (), {}),
...     ('addPoint', ((0, 1), 'line', False, None), {}),
...     ('addPoint', ((2, 3), 'line', False, None), {}),
...     ('addPoint', ((2, 5), None, False, None), {}),
...     ('addPoint', ((3, 6), None, False, None), {}),
...     ('addPoint', ((5, 6), 'qcurve', False, None), {}),
...     ('endPath', (), {}),
...     ('addComponent', ('a', (1.5, 0, 0, 1.5, 11, -10)), {}),
... ]
True
c                r   r	   r
   r   r   r   r   ZRoundingPointPen.__init__c   r   r   c                s    V P                   P                  ! V P                  V^ ,          4      V P                  V^,          4      33RVRVRVRV/VB  R# )r    segmentTypesmoothname
identifierN)r   addPointr   )r   r   r>   r?   r@   rA   kwargss   &&&&&&,r   rB   ZRoundingPointPen.addPointh   sh     	^^BqE"DNN2a5$9:	
#	
 	
 		

 "	
 	
r   c                s"   Vw  rVrxrV P                   P                  ! V\        V P                  V4      V P                  V4      V P                  V4      V P                  V4      V P	                  V	4      V P	                  V
4      4      3R V/VB  R# )rA   Nr*   )r   ZbaseGlyphNamer,   rA   rC   r-   r.   r/   r0   r1   r2   s   &&&&,      r   r+   ZRoundingPointPen.addComponentt   s    !/!!''+''+''+''+r"r"	
 "	
 	
r   r3   )NFNNr	   )r4   r5   r6   r7   r8   r   r   r   rB   r+   r9   r:   r;   r<   r=   r   r   r   E   s%     : *1W 5



 
r   N)ZfontTools.misc.roundToolsr   r   ZfontTools.misc.transformr   ZfontTools.pens.filterPenr   r   Z__all__r   r   ) r   r   <module>rD      s4    6 . > ,
-9
) 9
x=
~ =
r   