ó
    oñ:i|!  ã                   ó  • S SK Jr  S SKJr  \4S jr " S S\5      rS
S jr\S:X  aa  S SK	r	\
" \	R                  5      S	:X  a/  S SKr\	R                  " \R                  " 5       R                  5        \	R                  " \" 5       5        gg)é    )ÚCallable)ÚBasePenc                 ó:   ^• SR                  U4S jU  5       5      $ )NÚ c              3   ó4   >#   • U  H  nT" U5      v •  M     g 7f©N© )Ú.0ÚiÚntoss     €Ú\/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/fontTools/pens/svgPathPen.pyÚ	<genexpr>Ú pointToString.<locals>.<genexpr>   s   øé € Ð(¢R ‘D˜—G�G¢Rùs   ƒ)Újoin)Úptr   s    `r   ÚpointToStringr      s   ø€ Ø�8‰8Ô(¡RÓ(Ó(Ð(ó    c                   óh   • \ rS rSrSr\4S\\/\4   4S jjrS r	S r
S rS rS	 rS
 rS rS rSrg)Ú
SVGPathPené	   aU  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                 ót   • [         R                  " X5        / U l        S U l        S U l        S U l        X l        g r   )r   Ú__init__Ú	_commandsÚ_lastCommandÚ_lastXÚ_lastYÚ_ntos)ÚselfÚglyphSetr   s      r   r   ÚSVGPathPen.__init__+   s2   € Ü×Ò˜Ô(ØˆŒØ ˆÔØˆŒØˆŒØ�
r   c                 ó\   • U R                   S:X  a  U R                  R                  S5        gg)zi
>>> pen = SVGPathPen(None)
>>> pen.moveTo((0, 0))
>>> pen.moveTo((10, 10))
>>> pen._commands
['M10 10']
ÚMéÿÿÿÿN)r   r   Úpop©r   s    r   Ú_handleAnchorÚSVGPathPen._handleAnchor3   s)   € ð ×Ñ Ó#Ø�N‰N×Ñ˜rÕ"ð $r   c                 ó¶   • U R                  5         S[        XR                  5      -  nU R                  R	                  U5        SU l        Uu  U l        U l        g)zî
>>> 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   Ú_moveToÚSVGPathPen._moveTo>   sK   € ð" 	×ÑÔØ”] 2§z¡zÓ2Ñ3ˆØ�‰×Ñ˜aÔ ØˆÔØ#%Ñ ˆŒ�T•[r   c                 óÜ  • Uu  p#X R                   :X  a  X0R                  :X  a  gX R                   :X  a  SnU R                  U5      nOeX0R                  :X  a  SnU R                  U5      nOBU R                  S:X  a  SnS[	        XR                  5      -   nOSn[	        XR                  5      nSnU(       a
  Xd-  nX@l        Xe-  nU R
                  R                  U5        Uu  U l         U l        g)ae  
# 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   Ú_lineToÚSVGPathPen._lineToU   sÑ   € ðH ‰ˆà—‘Ó §[¡[Ó 0Øà—+‘+ÓØˆCØ—*‘*˜Q“-‰Cà—+‘+ÓØˆCØ—*‘*˜Q“-‰Cà×Ñ #Ó%ØˆCØœ b¯*©*Ó5Ñ5‰Cð ˆCÜ §J¡JÓ/ˆCàˆÞØ‰HˆAØ #ÔØ	‰ˆØ�‰×Ñ˜aÔ à#%Ñ ˆŒ�T•[r   c                 ó  • SnU[        XR                  5      S-   -  nU[        X R                  5      S-   -  nU[        X0R                  5      -  nU R                  R                  U5        SU l        Uu  U l        U l        g)zs
>>> 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   Ú_curveToOneÚSVGPathPen._curveToOne—   st   € ð ˆØ	Œ]˜3§
¡
Ó+¨cÑ1Ñ1ˆØ	Œ]˜3§
¡
Ó+¨cÑ1Ñ1ˆØ	Œ]˜3§
¡
Ó+Ñ+ˆØ�‰×Ñ˜aÔ ØˆÔØ#&Ñ ˆŒ�T•[r   c                 óÚ   • Uc   eSnU[        XR                  5      S-   -  nU[        X R                  5      -  nU R                  R                  U5        SU l        Uu  U l        U l        g)a'  
>>> 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   r:   )r   r;   r<   r*   s       r   Ú_qCurveToOneÚSVGPathPen._qCurveToOne¦   sf   € ð ‰ÐˆØˆØ	Œ]˜3§
¡
Ó+¨cÑ1Ñ1ˆØ	Œ]˜3§
¡
Ó+Ñ+ˆØ�‰×Ñ˜aÔ ØˆÔØ#&Ñ ˆŒ�T•[r   c                 ód   • U R                   R                  S5        SU l        S=U l        U l        g)zH
>>> pen = SVGPathPen(None)
>>> pen.closePath()
>>> pen._commands
['Z']
ÚZN)r   r)   r   r   r   r%   s    r   Ú
_closePathÚSVGPathPen._closePathº   s,   € ð 	�‰×Ñ˜cÔ"ØˆÔØ$(Ð(ˆŒ�d•kr   c                 ó.   • SU l         S=U l        U l        g)zC
>>> pen = SVGPathPen(None)
>>> pen.endPath()
>>> pen._commands
[]
N)r   r   r   r%   s    r   Ú_endPathÚSVGPathPen._endPathÅ   s   € ð !ˆÔØ$(Ð(ˆŒ�d•kr   c                 ó8   • SR                  U R                  5      $ )Nr1   )r   r   r%   s    r   ÚgetCommandsÚSVGPathPen.getCommandsÏ   s   € Ø�w‰w�t—~‘~Ó&Ð&r   )r   r   r   r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ústrr   Úfloatr   r&   r+   r6   r>   rB   rF   rI   rL   Ú__static_attributes__r	   r   r   r   r   	   sP   † ñðB ADñ  x°°¸°Ñ'=õ ò	#ò&ò.@&òD'ò'ò(	)ò)õ'r   r   Nc                 óž  ^• U c  SSK nUR                  SS n SSKJn  SSKnUR                  SSS9nUR                  SS	S
S9  UR                  SSSSS9  UR                  SSSS9  UR                  SS[        SS9  UR                  SSSSS9  UR                  U 5      nUR                  b  [        UR                  5      OSnU" UR                  US9nUR                  nUR                  n	0 n
UR                  R                  5        H9  nUR                  S5      nUS   R!                  5       n[#        US   5      nXêU'   M;     US   nUR$                  UR&                  nnUR)                  U
S9nUS    R+                  5       mU	b  Ub  [-        S!5      eU	c  S"R/                  U4S# jU 5       5      n	U	R                  5       n	SnSnU	 HN  nUU   n[1        U5      nUR3                  U5        UR5                  5       nUS$UUU4-  -  nUUR6                  -  nMP     [9        S%5        [9        S&UUU-
  4-  5        [9        USS'9  [9        S(5        g))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.)r[   Únargsr\   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)r[   Útyper\   z--variationszAXIS=LOCr1   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.)r[   Údefaultr\   )Ú
fontNumberÚ=Úhhea)ÚlocationÚcmapz)Options --glyphs and --text are exclusiver   c              3   ó@   >#   • U  H  nT[        U5         v •  M     g 7fr   )Úord)r
   Úurf   s     €r   r   Úmain.<locals>.<genexpr>  s   øé € Ð5²¨1˜$œs 1›vž,²ùs   ƒ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.ttLibrX   ÚargparseÚArgumentParserÚadd_argumentrS   Ú
parse_argsr3   ÚintrZ   r]   ÚglyphsÚ
variationsÚsplitÚstriprT   ÚascentÚdescentÚgetGlyphSetÚgetBestCmapÚ
ValueErrorr   r   ÚdrawrL   ÚwidthÚprint)Úargsrl   rX   ro   ÚparserÚoptionsrb   rZ   r]   rt   re   Útag_vÚfieldsÚtagÚvrd   rx   ry   ÚglyphsetÚsr~   ÚgÚglyphÚpenÚcommandsrf   s                            @r   Úmainr�   Ó   s�  ø€ ð �|Ûà�x‰x˜˜ˆ|ˆå&Ûà×$Ñ$Ø#Ð1Ið %ð €Fð ×Ñ˜¨
¸ÐÑFØ
×Ñ˜¨°cÀÐÑOØ
×ÑØØØ@ð ñ ð
 ×ÑØØ:ÜØ9ð	 ñ ð ×ÑØØØðLð	 ñ ð ×Ñ Ó%€Gà#*§9¡9Ñ#8”�W—Y‘Y”¸a€Já�'—,‘,¨:Ñ6€DØ�<‰<€DØ�^‰^€Fà€HØ×#Ñ#×)Ñ)Ö+ˆØ—‘˜SÓ!ˆØ�Q‰i�o‰oÓˆÜ�&˜‘)ÓˆØ�‹ñ	 ,ð �‰<€DØ—k‘k 4§<¡<ˆG€Fà×Ñ¨ÐÐ2€HØ�‰<×#Ñ#Ó%€DàÑ˜dÑ.ÜÐDÓEÐEà�~Ø—‘Ô5±Ó5Ó5ˆà�\‰\‹^€Fà
€AØ€EÛˆØ˜‘ˆä˜Ó"ˆØ�
‰
�3ŒØ—?‘?Ó$ˆà	ÐOØØØðS
ñ 
ñ 	
ˆð 	�—‘ÑŠñ ô 
Ð
2Ô3Ü	ØIØ�&˜7Ñ"Ð
#ñ	$ôô 
ˆ!�ÒÜ	ˆ(…Or   Ú__main__rW   r   )Útypingr   ÚfontTools.pens.basePenr   rS   r   r   r�   rN   rl   Úlenrm   ÚdoctestÚexitÚtestmodÚfailedr	   r   r   Ú<module>r–      sw   ðÝ Ý *ð ô )ôG'�ô G'ôTXðv ˆzÓÛá
ˆ3�8‰8ƒ}˜ÓÛà�Š�—’Ó"×)Ñ)Ô*à‡H‚H‰T‹VÕð r   