§
    ¢”j|!  ã                   ó  — d dl mZ d dlmZ efd„Z G d„ de¦  «        Zd
d„Zedk    rXd dl	Z	 e
e	j        ¦  «        d	k    r&d dlZ e	j         ej        ¦   «         j        ¦  «          e	j         e¦   «         ¦  «         dS dS )é    )ÚCallable)ÚBasePenc                 óF   ‡— d                      ˆfd„| D ¦   «         ¦  «        S )Nú c              3   ó.   •K  — | ]} ‰|¦  «        V — Œd S ©N© )Ú.0ÚiÚntoss     €úh/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/fontTools/pens/svgPathPen.pyú	<genexpr>z pointToString.<locals>.<genexpr>   s+   øè è € Ð(Ð( �D�D˜‘G”GÐ(Ð(Ð(Ð(Ð(Ð(ó    )Újoin)Úptr   s    `r   ÚpointToStringr      s*   ø€ Ø�8Š8Ð(Ð(Ð(Ð( RÐ(Ñ(Ô(Ñ(Ô(Ð(r   c                   ód   — e Zd ZdZefdeegef         fd„Zd„ Zd„ Z	d„ Z
d„ Zd„ Zd	„ Zd
„ Zd„ ZdS )Ú
SVGPathPena½  Pen to draw SVG path d commands.

    Args:
        glyphSet: a dictionary of drawable glyph objects keyed by name
            used to resolve component references in composite glyphs.
        ntos: a callable that takes a number and returns a string, to
            customize how numbers are formatted (default: str).

    :Example:
        .. code-block::

            >>> pen = SVGPathPen(None)
            >>> pen.moveTo((0, 0))
            >>> pen.lineTo((1, 1))
            >>> pen.curveTo((2, 2), (3, 3), (4, 4))
            >>> pen.closePath()
            >>> pen.getCommands()
            'M0 0 1 1C2 2 3 3 4 4Z'

    Note:
        Fonts have a coordinate system where Y grows up, whereas in SVG,
        Y grows down.  As such, rendering path data from this pen in
        SVG typically results in upside-down glyphs.  You can fix this
        by wrapping the data from this pen in an SVG group element with
        transform, or wrap this pen in a transform pen.  For example:
        .. code-block:: python

            spen = svgPathPen.SVGPathPen(glyphset)
            pen= TransformPen(spen , (1, 0, 0, -1, 0, 0))
            glyphset[glyphname].draw(pen)
            print(tpen.getCommands())
    r   c                 óv   — t          j        | |¦  «         g | _        d | _        d | _        d | _        || _        d S r   )r   Ú__init__Ú	_commandsÚ_lastCommandÚ_lastXÚ_lastYÚ_ntos)ÚselfÚglyphSetr   s      r   r   zSVGPathPen.__init__+   s=   € ÝÔ˜˜xÑ(Ô(Ð(ØˆŒØ ˆÔØˆŒØˆŒØˆŒ
ˆ
ˆ
r   c                 óT   — | j         dk    r| j                             d¦  «         dS dS )z™
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((0, 0))
        >>> pen.moveTo((10, 10))
        >>> pen._commands
        ['M10 10']
        ÚMéÿÿÿÿN)r   r   Úpop©r   s    r   Ú_handleAnchorzSVGPathPen._handleAnchor3   s6   € ð Ô Ò#Ð#ØŒN×Ò˜rÑ"Ô"Ð"Ð"Ð"ð $Ð#r   c                 ó¾   — |                       ¦   «          dt          || j        ¦  «        z  }| j                             |¦  «         d| _        |\  | _        | _        dS )aV  
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((0, 0))
        >>> pen._commands
        ['M0 0']

        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((10, 0))
        >>> pen._commands
        ['M10 0']

        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((0, 10))
        >>> pen._commands
        ['M0 10']
        zM%sr   N)r#   r   r   r   Úappendr   r   r   )r   r   Úts      r   Ú_moveTozSVGPathPen._moveTo>   s\   € ð" 	×ÒÑÔÐØ•] 2 t¤zÑ2Ô2Ñ3ˆØŒ×Ò˜aÑ Ô Ð ØˆÔØ#%Ñ ˆŒ�T”[�[�[r   c                 óÂ  — |\  }}|| j         k    r|| j        k    rdS || j         k    rd}|                      |¦  «        }n`|| j        k    rd}|                      |¦  «        }n=| j        dk    rd}dt	          || j        ¦  «        z   }nd}t	          || j        ¦  «        }d}|r||z  }|| _        ||z  }| j                             |¦  «         |\  | _         | _        dS )aU  
        # duplicate point
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((10, 10))
        >>> pen.lineTo((10, 10))
        >>> pen._commands
        ['M10 10']

        # vertical line
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((10, 10))
        >>> pen.lineTo((10, 0))
        >>> pen._commands
        ['M10 10', 'V0']

        # horizontal line
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((10, 10))
        >>> pen.lineTo((0, 10))
        >>> pen._commands
        ['M10 10', 'H0']

        # basic
        >>> pen = SVGPathPen(None)
        >>> pen.lineTo((70, 80))
        >>> pen._commands
        ['L70 80']

        # basic following a moveto
        >>> pen = SVGPathPen(None)
        >>> pen.moveTo((0, 0))
        >>> pen.lineTo((10, 10))
        >>> pen._commands
        ['M0 0', ' 10 10']
        NÚVÚHr   r   ÚLÚ )r   r   r   r   r   r   r%   )r   r   ÚxÚyÚcmdÚptsr&   s          r   Ú_lineTozSVGPathPen._lineToU   s  € ðH ‰ˆˆ1à�”ÒÐ  T¤[Ò 0Ð 0ØˆFà�$”+ÒÐØˆCØ—*’*˜Q‘-”-ˆCˆCà�$”+ÒÐØˆCØ—*’*˜Q‘-”-ˆCˆCàÔ #Ò%Ð%ØˆCØ� b¨$¬*Ñ5Ô5Ñ5ˆCˆCð ˆCÝ  D¤JÑ/Ô/ˆCàˆØð 	$Ø�‰HˆAØ #ˆDÔØ	ˆS‰ˆØŒ×Ò˜aÑ Ô Ð à#%Ñ ˆŒ�T”[�[�[r   c                 ó  — d}|t          || j        ¦  «        dz   z  }|t          || j        ¦  «        dz   z  }|t          || j        ¦  «        z  }| j                             |¦  «         d| _        |\  | _        | _        dS )z›
        >>> pen = SVGPathPen(None)
        >>> pen.curveTo((10, 20), (30, 40), (50, 60))
        >>> pen._commands
        ['C10 20 30 40 50 60']
        ÚCr   N©r   r   r   r%   r   r   r   )r   Úpt1Úpt2Úpt3r&   s        r   Ú_curveToOnezSVGPathPen._curveToOne—   s…   € ð ˆØ	�]˜3 ¤
Ñ+Ô+¨cÑ1Ñ1ˆØ	�]˜3 ¤
Ñ+Ô+¨cÑ1Ñ1ˆØ	�]˜3 ¤
Ñ+Ô+Ñ+ˆØŒ×Ò˜aÑ Ô Ð ØˆÔØ#&Ñ ˆŒ�T”[�[�[r   c                 óØ   — |€J ‚d}|t          || j        ¦  «        dz   z  }|t          || j        ¦  «        z  }| j                             |¦  «         d| _        |\  | _        | _        dS )aw  
        >>> pen = SVGPathPen(None)
        >>> pen.qCurveTo((10, 20), (30, 40))
        >>> pen._commands
        ['Q10 20 30 40']
        >>> from fontTools.misc.roundTools import otRound
        >>> pen = SVGPathPen(None, ntos=lambda v: str(otRound(v)))
        >>> pen.qCurveTo((3, 3), (7, 5), (11, 4))
        >>> pen._commands
        ['Q3 3 5 4', 'Q7 5 11 4']
        NÚQr   r4   )r   r5   r6   r&   s       r   Ú_qCurveToOnezSVGPathPen._qCurveToOne¦   ss   € ð ˆˆˆØˆØ	�]˜3 ¤
Ñ+Ô+¨cÑ1Ñ1ˆØ	�]˜3 ¤
Ñ+Ô+Ñ+ˆØŒ×Ò˜aÑ Ô Ð ØˆÔØ#&Ñ ˆŒ�T”[�[�[r   c                 ód   — | j                              d¦  «         d| _        dx| _        | _        dS )zp
        >>> pen = SVGPathPen(None)
        >>> pen.closePath()
        >>> pen._commands
        ['Z']
        ÚZN)r   r%   r   r   r   r"   s    r   Ú
_closePathzSVGPathPen._closePathº   s4   € ð 	Œ×Ò˜cÑ"Ô"Ð"ØˆÔØ$(Ð(ˆŒ�d”k�k�kr   c                 ó0   — d| _         dx| _        | _        dS )zk
        >>> pen = SVGPathPen(None)
        >>> pen.endPath()
        >>> pen._commands
        []
        N)r   r   r   r"   s    r   Ú_endPathzSVGPathPen._endPathÅ   s   € ð !ˆÔØ$(Ð(ˆŒ�d”k�k�kr   c                 ó6   — d                      | j        ¦  «        S )Nr,   )r   r   r"   s    r   ÚgetCommandszSVGPathPen.getCommandsÏ   s   € Ø�wŠw�t”~Ñ&Ô&Ð&r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   Úfloatr   r#   r'   r1   r8   r;   r>   r@   rB   r	   r   r   r   r   	   sÍ   € € € € € ðð ðB ADð ð  x°°¸°Ô'=ð ð ð ð ð	#ð 	#ð 	#ð&ð &ð &ð.@&ð @&ð @&ðD'ð 'ð 'ð'ð 'ð 'ð(	)ð 	)ð 	)ð)ð )ð )ð'ð 'ð 'ð 'ð 'r   r   Nc                 óN  ‡— | €ddl }|j        dd…         } ddlm} ddl}|                     dd¬¦  «        }|                     dd	d
¬¦  «         |                     dddd¬¦  «         |                     ddd¬¦  «         |                     ddt          d¬¦  «         |                     dddd¬¦  «         |                     | ¦  «        }|j	        �t          |j	        ¦  «        nd} ||j        |¬¦  «        }|j        }|j        }	i }
|j                             ¦   «         D ]K}|                     d¦  «        }|d                              ¦   «         }t#          |d         ¦  «        }||
|<   ŒL|d         }|j        |j        }}|                     |
¬¦  «        }|d                               ¦   «         Š|	�|�t-          d!¦  «        ‚|	€!d"                     ˆfd#„|D ¦   «         ¦  «        }	|	                     ¦   «         }	d}d}|	D ]W}||         }t1          |¦  «        }|                     |¦  «         |                     ¦   «         }|d$|||fz  z  }||j        z  }ŒXt9          d%¦  «         t9          d&|||z
  fz  ¦  «         t9          |d¬'¦  «         t9          d(¦  «         dS ))z-Generate per-character SVG from font and textNr   é   )ÚTTFontzfonttools pens.svgPathPenzGenerate SVG from text)ÚdescriptionÚfontzfont.ttfz
Font file.)ÚmetavarÚhelpÚtextú?zText string.)rN   ÚnargsrO   z-yz<number>z1Face index into a collection to open. Zero based.z--glyphsz(whitespace-separated list of glyph namesz*Glyphs to show. Exclusive with text option)rN   ÚtyperO   z--variationszAXIS=LOCr,   z¼List of space separated locations. A location consist in the name of a variation axis, followed by '=' and a number. E.g.: wght=700 wdth=80. The default is the location of the base master.)rN   ÚdefaultrO   )Ú
fontNumberú=Úhhea)ÚlocationÚcmapz)Options --glyphs and --text are exclusiver   c              3   óB   •K  — | ]}‰t          |¦  «                 V — Œd S r   )Úord)r
   ÚurY   s     €r   r   zmain.<locals>.<genexpr>  s-   øè è € Ð5Ð5¨1˜$�s 1™vœvœ,Ð5Ð5Ð5Ð5Ð5Ð5r   z?<g transform="translate(%d %d) scale(1 -1)"><path d="%s"/></g>
z&<?xml version="1.0" encoding="UTF-8"?>z?<svg width="%d" height="%d" xmlns="http://www.w3.org/2000/svg">)Úendz</svg>)ÚsysÚargvÚfontTools.ttLibrK   ÚargparseÚArgumentParserÚadd_argumentrG   Ú
parse_argsr.   ÚintrM   rP   ÚglyphsÚ
variationsÚsplitÚstriprH   ÚascentÚdescentÚgetGlyphSetÚgetBestCmapÚ
ValueErrorr   r   ÚdrawrB   ÚwidthÚprint)Úargsr^   rK   ra   ÚparserÚoptionsrU   rM   rP   rf   rX   Útag_vÚfieldsÚtagÚvrW   rj   rk   ÚglyphsetÚsrp   ÚgÚglyphÚpenÚcommandsrY   s                            @r   Úmainr   Ó   s5  ø€ ð €|Øˆ
ˆ
ˆ
àŒx˜˜˜Œ|ˆà&Ð&Ð&Ð&Ð&Ð&Ø€O€O€Oà×$Ò$Ø#Ð1Ið %ñ ô €Fð ×Ò˜¨
¸ÐÑFÔFÐFØ
×Ò˜¨°cÀÐÑOÔOÐOØ
×ÒØØØ@ð ñ ô ð ð
 ×ÒØØ:ÝØ9ð	 ñ ô ð ð ×ÒØØØðLð	 ñ ô ð ð ×Ò Ñ%Ô%€Gà#*¤9Ð#8•�W”Y‘”�¸a€Jàˆ6�'”,¨:Ð6Ñ6Ô6€DØŒ<€DØŒ^€Fà€HØÔ#×)Ò)Ñ+Ô+ð ð ˆØ—’˜SÑ!Ô!ˆØ�QŒi�oŠoÑÔˆÝ�&˜”)ÑÔˆØˆ�‰ˆà�Œ<€DØ”k 4¤<ˆG€Fà×Ò¨ÐÑ2Ô2€HØ�Œ<×#Ò#Ñ%Ô%€DàÐ˜dÐ.ÝÐDÑEÔEÐEà€~Ø—’Ð5Ð5Ð5Ð5°Ð5Ñ5Ô5Ñ5Ô5ˆà�\Š\‰^Œ^€Fà
€AØ€EØð ð ˆØ˜”ˆå˜Ñ"Ô"ˆØ�
Š
�3‰ŒˆØ—?’?Ñ$Ô$ˆà	ÐOØØØðS
ñ 
ñ 	
ˆð 	�”Ñˆˆå	Ð
2Ñ3Ô3Ð3Ý	ØIØ�&˜7Ñ"Ð
#ñ	$ñô ð õ 
ˆ!�ÐÑÔÐÝ	ˆ(�O„O€O€O€Or   Ú__main__rJ   r   )Útypingr   ÚfontTools.pens.basePenr   rG   r   r   r   rC   r^   Úlenr_   ÚdoctestÚexitÚtestmodÚfailedr	   r   r   ú<module>rˆ      s  ðØ Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *ð ð )ð )ð )ð )ðG'ð G'ð G'ð G'ð G'�ñ G'ô G'ð G'ðTXð Xð Xð Xðv ˆzÒÐØ€J€J€Jà
€sˆ3Œ8�}„}˜ÒÐØˆˆˆàˆŒ��”Ñ"Ô"Ô)Ñ*Ô*Ð*à€C„HˆTˆT‰VŒVÑÔÐÐÐð Ðr   