§
    ¢”j  ã                   ór   — d dl mZmZ d dlmZ d dlmZmZ ddgZ G d„ de¦  «        Z	 G d„ de¦  «        Z
dS )	é    )ÚnoRoundÚotRound)Ú	Transform)Ú	FilterPenÚFilterPointPenÚRoundingPenÚRoundingPointPenc                   óF   ‡ — e Zd ZdZeefˆ fd„	Zd„ Zd„ Zd„ Z	d„ Z
d„ Zˆ xZS )r   ag  
    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                 óf   •— t          ¦   «                              |¦  «         || _        || _        d S ©N©ÚsuperÚ__init__Ú	roundFuncÚtransformRoundFunc©ÚselfÚoutPenr   r   Ú	__class__s       €úi/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/fontTools/pens/roundingPen.pyr   zRoundingPen.__init__!   ó0   ø€ Ý‰Œ×Ò˜Ñ Ô Ð Ø"ˆŒØ"4ˆÔÐÐó    c                 ó¢   — | j                              |                      |d         ¦  «        |                      |d         ¦  «        f¦  «         d S ©Nr   é   )Ú_outPenÚmoveTor   ©r   Úpts     r   r   zRoundingPen.moveTo&   óC   € ØŒ×Ò˜TŸ^š^¨B¨q¬EÑ2Ô2°D·N²NÀ2ÀaÄ5Ñ4IÔ4IÐJÑKÔKÐKÐKÐKr   c                 ó¢   — | j                              |                      |d         ¦  «        |                      |d         ¦  «        f¦  «         d S r   )r   ÚlineTor   r   s     r   r"   zRoundingPen.lineTo)   r    r   c                 ó>   ‡ —  ‰ j         j        ˆ fd„|D ¦   «         Ž  d S )Nc              3   ór   •K  — | ]1\  }}‰                      |¦  «        ‰                      |¦  «        fV — Œ2d S r   ©r   ©Ú.0ÚxÚyr   s      €r   ú	<genexpr>z&RoundingPen.curveTo.<locals>.<genexpr>.   óD   øè è € ÐHÐH¹¸¸Aˆt�~Š~˜aÑ Ô  $§.¢.°Ñ"3Ô"3Ð4ÐHÐHÐHÐHÐHÐHr   )r   ÚcurveTo©r   Úpointss   ` r   r,   zRoundingPen.curveTo,   s8   ø€ ØˆŒÔØHÐHÐHÐHÀÐHÑHÔHð	
ð 	
ð 	
ð 	
r   c                 ó>   ‡ —  ‰ j         j        ˆ fd„|D ¦   «         Ž  d S )Nc              3   ór   •K  — | ]1\  }}‰                      |¦  «        ‰                      |¦  «        fV — Œ2d S r   r%   r&   s      €r   r*   z'RoundingPen.qCurveTo.<locals>.<genexpr>3   r+   r   )r   ÚqCurveTor-   s   ` r   r1   zRoundingPen.qCurveTo1   s8   ø€ ØˆŒÔØHÐHÐHÐHÀÐHÑHÔHð	
ð 	
ð 	
ð 	
r   c                 óV  — |\  }}}}}}| j                              |t          |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |¦  «        ¦  «        ¦  «         d S r   ©r   ÚaddComponentr   r   r   )	r   Ú	glyphNameÚtransformationÚxxÚxyÚyxÚyyÚdxÚdys	            r   r4   zRoundingPen.addComponent6   sª   € Ø!/ÑˆˆB��B˜˜BØŒ×!Ò!ØÝØ×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø—’˜rÑ"Ô"Ø—’˜rÑ"Ô"ñô ñ
	
ô 
	
ð 
	
ð 
	
ð 
	
r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r"   r,   r1   r4   Ú__classcell__©r   s   @r   r   r   	   sŸ   ø€ € € € € ðð ð. *1ÀWð 5ð 5ð 5ð 5ð 5ð 5ð
Lð Lð LðLð Lð Lð
ð 
ð 
ð

ð 
ð 
ð

ð 
ð 
ð 
ð 
ð 
ð 
r   c                   ó:   ‡ — e Zd ZdZeefˆ fd„	Z	 dd„Zdd„Zˆ xZ	S )	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                 óf   •— t          ¦   «                              |¦  «         || _        || _        d S r   r   r   s       €r   r   zRoundingPointPen.__init__c   r   r   NFc                 óž   —  | j         j        |                      |d         ¦  «        |                      |d         ¦  «        ff||||dœ|¤Ž d S )Nr   r   )ÚsegmentTypeÚsmoothÚnameÚ
identifier)r   ÚaddPointr   )r   r   rF   rG   rH   rI   Úkwargss          r   rJ   zRoundingPointPen.addPointh   so   € ð 	ˆŒÔØ�^Š^˜B˜qœEÑ"Ô" D§N¢N°2°a´5Ñ$9Ô$9Ð:ð	
à#ØØØ!ð	
ð 	
ð ð	
ð 	
ð 	
ð 	
ð 	
r   c                 óL  — |\  }}}}}	}
 | j         j        |t          |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |¦  «        |                      |	¦  «        |                      |
¦  «        ¦  «        fd|i|¤Ž d S )NrI   r3   )r   ÚbaseGlyphNamer6   rI   rK   r7   r8   r9   r:   r;   r<   s              r   r4   zRoundingPointPen.addComponentt   sÂ   € Ø!/ÑˆˆB��B˜˜BØ!ˆŒÔ!ØÝØ×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø×'Ò'¨Ñ+Ô+Ø—’˜rÑ"Ô"Ø—’˜rÑ"Ô"ñô ð	
ð 	
ð "ð	
ð ð	
ð 	
ð 	
ð 	
ð 	
r   )NFNNr   )
r=   r>   r?   r@   r   r   r   rJ   r4   rA   rB   s   @r   r	   r	   E   s}   ø€ € € € € ðð ð: *1ÀWð 5ð 5ð 5ð 5ð 5ð 5ð IMð

ð 

ð 

ð 

ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r   N)ÚfontTools.misc.roundToolsr   r   ÚfontTools.misc.transformr   ÚfontTools.pens.filterPenr   r   Ú__all__r   r	   © r   r   ú<module>rS      s³   ðØ 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø .Ð .Ð .Ð .Ð .Ð .Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >ð Ð,Ð
-€ð9
ð 9
ð 9
ð 9
ð 9
�)ñ 9
ô 9
ð 9
ðx=
ð =
ð =
ð =
ð =
�~ñ =
ô =
ð =
ð =
ð =
r   