+
    i|!                        ^ 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# )
    )Callable)BasePenc                 :   a R P                  V3R lV  4       4      # ) c              3   4   <"   T F  pS! V4      x  K  	  R # 5iN ).0intoss   & y/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/fontTools/pens/svgPathPen.py	<genexpr> pointToString.<locals>.<genexpr>   s     (RDGGRs   )join)ptr   s   &fr   pointToStringr      s    88(R(((    c                   l   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                8   < V ^8  d   QhRS[ S[.S[3,          /# )   r   )r   floatstr)format__classdict__s   "r   __annotate__SVGPathPen.__annotate__+   s      x'= r   c                v    \         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)selfglyphSetr   s   &&&r   r   SVGPathPen.__init__+   s2    ( 
r   c                b    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']
MN)r!   r    popr%   s   &r   _handleAnchorSVGPathPen._handleAnchor3   s)     #NNr" $r   c                    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   _moveToSVGPathPen._moveTo>   sK    " 	]2zz23a #% T[r   c                   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']
NVHr)   r   L )r"   r#   r$   r!   r   r    r0   )r%   r   xycmdptsr1   s   &&     r   _lineToSVGPathPen._lineToU   s    H [[ 0++C**Q-C++C**Q-C#%Cb**55C CJJ/CHA #	a #% T[r   c                0   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']
Cr   Nr   r$   r    r0   r!   r"   r#   )r%   pt1pt2pt3r1   s   &&&& r   _curveToOneSVGPathPen._curveToOne   st     	]3

+c11	]3

+c11	]3

++a #& T[r   c                    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']
NQr   rA   )r%   rB   rC   r1   s   &&& r   _qCurveToOneSVGPathPen._qCurveToOne   sf     	]3

+c11	]3

++a #& T[r   c                f    V P                   P                  R4       RV n        R;V n        V n        R# )zH
>>> pen = SVGPathPen(None)
>>> pen.closePath()
>>> pen._commands
['Z']
ZN)r    r0   r!   r"   r#   r,   s   &r   
_closePathSVGPathPen._closePath   s,     	c"$((dkr   c                0    RV n         R;V n        V n        R# )zC
>>> pen = SVGPathPen(None)
>>> pen.endPath()
>>> pen._commands
[]
N)r!   r"   r#   r,   s   &r   _endPathSVGPathPen._endPath   s     !$((dkr   c                8    R P                  V P                  4      # )r8   )r   r    r,   s   &r   getCommandsSVGPathPen.getCommands   s    wwt~~&&r   )r    r!   r"   r#   r$   N)__name__
__module____qualname____firstlineno____doc__r   r   r-   r2   r=   rE   rI   rM   rP   rS   __static_attributes____classdictcell__)r   s   @r   r   r   	   sK     B AD  	#&.@&D''(	))' 'r   r   Nc                8  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:   NN)TTFontzfonttools pens.svgPathPenzGenerate SVG from text)descriptionfontzfont.ttfz
Font file.)metavarhelptext?zText string.)ra   nargsrb   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)ra   typerb   z--variationszAXIS=LOCr8   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.)ra   defaultrb   )
fontNumber=hhea)locationcmapz)Options --glyphs and --text are exclusiver   c              3   H   <"   T F  pS\        V4      ,          x  K  	  R # 5ir   )ord)r
   url   s   & r   r   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">)endz</svg>)sysargvfontTools.ttLibr^   argparseArgumentParseradd_argumentr   
parse_argsr:   intr`   rc   glyphs
variationssplitstripr   ascentdescentgetGlyphSetgetBestCmap
ValueErrorr   r   drawrS   widthprint)argsrr   r^   ru   parseroptionsrh   r`   rc   rz   rk   tag_vfieldstagvrj   r~   r   glyphsetsr   gglyphpencommandsrl   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   __main__r   )typingr   fontTools.pens.basePenr   r   r   r   r   rU   rr   lenrs   doctestexittestmodfailedr	   r   r   <module>r      sw     *  )G' G'TXv z
388}"))*HHTV r   