+
    f7i|!  c                   s   ^ RI Ht ^ RIHt ]3R lt ! R R]4      tR	R lt]R8X  dd   ^ RI	t	]
! ]	P                  4      ^8X  d0   ^ RIt]	P                  ! ]P                  ! 4       P                  4       ]	P                  ! ]! 4       4       R# R# )
i    )Callable)BasePenc                 s:   a R P                  V3R lV  4       4      # ) c              3   s4   <"   T F  pS! V4      x  K  	  R # 5iN ).0Zintos   & @/usr/lib64/python3.14/site-packages/fontTools/pens/svgPathPen.py	<genexpr>Z pointToString.<locals>.<genexpr>   s     (RDGGRs   )join)ptr   s   &fr   pointToStringr      s    88(R(((    c                   sl   a  ] tR t^	t o Rt]3V 3R lR lltR tR tR t	R t
R tR	 tR
 tR tRtV tR# )
SVGPathPenaU  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())
c                s8   < V ^8  d   QhRS[ S[.S[3,          /# )i   r   )r    floatstr)Zformat__classdict__s   "r   Z__annotate__ZSVGPathPen.__annotate__+   s      x'= r   c                sv    \         P                  ! W4       . V n        R V n        R V n        R V n        W n        R # r   )r   __init__	_commands_lastCommand_lastX_lastY_ntos)selfZglyphSetr   s   &&&r   r   ZSVGPathPen.__init__+   s2    ( 
r   c                sb    V P                   R8X  d   V P                  P                  R4       R# R# )zi
>>> pen = SVGPathPen(None)
>>> pen.moveTo((0, 0))
>>> pen.moveTo((10, 10))
>>> pen._commands
['M10 10']
MNi)r   r   Zpopr      &r   _handleAnchorZSVGPathPen._handleAnchor3   s)     #NNr" $r   c                s    V P                  4        R\        WP                  4      ,          pV P                  P	                  V4       RV n        Vw  V n        V n        R# )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   _moveToZSVGPathPen._moveTo>   sK    " 	]2zz23a #% T[r   c                s   Vw  r#W P                   8X  d   W0P                  8X  d   R# W P                   8X  d   RpV P                  V4      pMkW0P                  8X  d   RpV P                  V4      pMGV P                  R8X  d    RpR\	        WP                  4      ,           pMRp\	        WP                  4      pRpV'       d   Wd,          pW@n        We,          pV P
                  P                  V4       Vw  V n         V n        R# )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']
NZVZHr   r   ZL )r   r   r   r   r   r   r   )r   r   ZxyZcmdZptsr   s   &&     r   _lineToZSVGPathPen._lineToU   s    H [[ 0++C**Q-C++C**Q-C#%Cb**55C CJJ/CHA #	a #% T[r   c                s0   RpV\        WP                  4      R,           ,          pV\        W P                  4      R,           ,          pV\        W0P                  4      ,          pV P                  P                  V4       RV n        Vw  V n        V n        R# )zs
>>> pen = SVGPathPen(None)
>>> pen.curveTo((10, 20), (30, 40), (50, 60))
>>> pen._commands
['C10 20 30 40 50 60']
ZCr   Nr   r   r   r   r   r   r   )r   pt1pt2Zpt3r   s   &&&& r   _curveToOneZSVGPathPen._curveToOne   st     	]3

+c11	]3

+c11	]3

++a #& T[r   c                s    Vf   Q hRpV\        WP                  4      R,           ,          pV\        W P                  4      ,          pV P                  P                  V4       RV n        Vw  V n        V n        R# )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']
NZQr   r#   )r   r$   r%   r   s   &&& r   _qCurveToOneZSVGPathPen._qCurveToOne   sf     	]3

+c11	]3

++a #& T[r   c                sf    V P                   P                  R4       RV n        R;V n        V n        R# )zH
>>> pen = SVGPathPen(None)
>>> pen.closePath()
>>> pen._commands
['Z']
ZZN)r   r   r   r   r   r   r   r   
_closePathZSVGPathPen._closePath   s,     	c"$((dkr   c                s0    RV n         R;V n        V n        R# )zC
>>> pen = SVGPathPen(None)
>>> pen.endPath()
>>> pen._commands
[]
N)r   r   r   r   r   r   _endPathZSVGPathPen._endPath   s     !$((dkr   c                s8    R P                  V P                  4      # )r    )r
   r   r   r   r   getCommandsZSVGPathPen.getCommands   s    wwt~~&&r   )r   r   r   r   r   N)__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   r   r   r"   r&   r'   r(   r)   r*   Z__static_attributes__Z__classdictcell__)r   s   @r   r   r   	   sK     B AD  	#&.@&D''(	))' 'r   r   Nc                s8  a V f   ^ RI pVP                  R,          p ^ RIHp ^ RIpVP                  RRR7      pVP                  RRR	R
7       VP                  RRRRR7       VP                  RRRR
7       VP                  RR\        RR7       VP                  RRRRR7       VP                  V 4      pVP                  e   \        VP                  4      M^ pV! VP                  VR7      pVP                  pVP                  p	/ p
VP                  P                  4        FA  pVP                  R4      pV^ ,          P!                  4       p\#        V^,          4      pWV&   KC  	  VR,          pVP$                  VP&                  ppVP)                  V
R7      pVR,          P+                  4       oV	e   Ve   \-        R 4      hV	f   R!P/                  V3R" lV 4       4      p	V	P                  4       p	Rp^ pV	 F^  pVV,          p\1        V4      pVP3                  V4       VP5                  4       pVR#VVV3,          ,          pVVP6                  ,          pK`  	  \9        R$4       \9        R%VVV,
          3,          4       \9        VRR&7       \9        R'4       R# )(z-Generate per-character SVG from font and textN:i   NN)TTFontzfonttools pens.svgPathPenzGenerate SVG from text)Zdescriptionfontzfont.ttfz
Font file.)metavarhelptextZ?zText string.)r.   Z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.   Ztyper/   z--variationszAXIS=LOCr    zList 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.   Zdefaultr/   )
fontNumberZ=hhea)locationcmapz)Options --glyphs and --text are exclusiver   c              3   sH   <"   T F  pS\        V4      ,          x  K  	  R # 5ir   )Zord)r   Zur4   r   r   r	   Zmain.<locals>.<genexpr>  s     51$s1v,,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">)Zendz</svg>)sysargvZfontTools.ttLibr,   argparseZArgumentParserZadd_argumentr   Z
parse_argsr!   Zintr-   r0   glyphsZ
variationsZsplitZstripr   ascentdescentZgetGlyphSetZgetBestCmapZ
ValueErrorr
   r   Zdrawr*   widthZprint)Zargsr5   r,   r7   ZparserZoptionsr1   r-   r0   r8   r3   Ztag_vZfieldsZtagZvr2   r9   r:   ZglyphsetZsr;   ZgZglyphZpenZcommandsr4   s   &                        @r   mainr<      s    |xx|&$$#1I % F 
F
cO
@  
 :9	   L	   %G#*99#8WYYaJ',,:6D<<D^^FH##))+S!Qioo&)	 , <Dkk4<<GF2H<##%Dd.DEE~555\\^F
AE"

3??$	OS
 
 	
 	  

23	I&7"
#	$ 
!	(Or   Z__main__r   )Ztypingr    ZfontTools.pens.basePenr   r   r   r   r<   r+   r5   Zlenr6   ZdoctestZexitZtestmodZfailedr   r   r   <module>r=      sw     *  )G' G'TXv z
388}"))*HHTV r   