+
    i3                         ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtH	t	 ^ RI
HtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ]P2                  ! ]4      t ! R
 R4      t]! 4       t ! R R]4      tR# )    )OrderedDictN)_text_helpersdviread)FontPropertiesget_fontfontManager)	LoadFlags)MathTextParser)Path)
TexManager)Affine2Dc                      a  ] tR t^t o RtRt^HtR tR tR t	R t
R tRR ltRR
 ltRR ltRR lt]R 4       tRtV tR	# )
TextToPathz'A class that converts strings to paths.g      Y@c                4    \        R 4      V n        RV n        R# )pathN)r
   mathtext_parser_texmanagerselfs   &s/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/textpath.py__init__TextToPath.__init__   s    -f5    c                    \         P                  ! V4      p\        V4      pVP                  V P                  V P
                  4       V# )zH
Find the `FT2Font` matching font properties *prop*, with its size set.
)_fontManager_find_fonts_by_propsr   set_size
FONT_SCALEDPI)r   prop	filenamesfonts   &&  r   	_get_fontTextToPath._get_font   s9     !55d;		"dootxx0r   c                "    \         P                  # )N)r	   
NO_HINTINGr   s   &r   _get_hinting_flagTextToPath._get_hinting_flag'   s    ###r   c                `    \         P                  P                  VP                   RVR 24      # )z?
Return a unique id for the given font and character-code set.
-x)urllibparsequotepostscript_name)r   r"   ccodes   &&&r   _get_char_idTextToPath._get_char_id*   s-     ||!!T%9%9$:!E!9"EFFr   c                f   VP                  4       pVR 8X  d   \        4       P                  W4      # W@P                  ,          pV'       db   VP	                  4       pVP                  V P                  4       V P                  P                  V^HV4      vrgrWe,          Wu,          W,          3# V P                  V4      p
V
P                  VR\        P                  R7       V
P                  4       w  rVR,          pVR,          pV
P                  4       pVR,          pW,          W,          W,          3# )TeXg        flagsg      P@)get_size_in_pointsr   get_text_width_height_descentr   copyr   r   r-   r#   set_textr	   r&   get_width_heightget_descent)r   sr    ismathfontsizescalewidthheightdescent_r"   whds   &&&&          r   r8   (TextToPath.get_text_width_height_descent0   s    **,U?<==aJJ??*99;DMM$//*$$**1b$7 'E7=&.'/AA~~d#aI$8$89$$&	T		T		T	y!)QY..r   c                   VR8X  d   V P                  W4      w  rEpMBV'       g'   V P                  V4      pV P                  Wr4      w  rEpMV P                  W4      w  rEp. . rV F@  w  rrWZ,          w  rVP	                  W,          W.,           4       V	P	                  V4       KB  	  V F'  w  rVP	                  V4       V	P	                  V4       K)  	  V'       g   \
        P                  ! R4      pW3# )a  
Convert text *s* to path (a tuple of vertices and codes for
matplotlib.path.Path).

Parameters
----------
prop : `~matplotlib.font_manager.FontProperties`
    The font properties for the text.
s : str
    The text to be converted.
ismath : {False, True, "TeX"}
    If True, use mathtext parser.  If "TeX", use tex for rendering.

Returns
-------
verts : list
    A list of arrays containing the (x, y) coordinates of the vertices.
codes : list
    A list of path codes.

Examples
--------
Create a list of vertices and codes from a text, and create a `.Path`
from those::

    from matplotlib.path import Path
    from matplotlib.text import TextToPath
    from matplotlib.font_manager import FontProperties

    fp = FontProperties(family="Comic Neue", style="italic")
    verts, codes = TextToPath().get_text_path(fp, "ABC")
    path = Path(verts, codes, closed=False)

Also see `TextPath` for a more direct way to create a path from a text.
r4   )r      )get_glyphs_texr#   get_glyphs_with_fontget_glyphs_mathtextextendnpempty)r   r    r=   r>   
glyph_info	glyph_maprectsr"   vertscodesglyph_id	xposition	ypositionr@   verts1codes1s   &&&&            r   get_text_pathTextToPath.get_text_pathH   s    H U?+/+>+>t+G(J5>>$'D+/+D+DT+M(J5+/+C+CD+L(J52u5?1H&0NFLL9*@@ALL  6@ $NFLL LL  $ HHV$E|r   Nc                   Vf   \        4       pV'       d   \        4       pMTp. p. p\        P                  ! W!4       F  pV P                  VP                  \        VP                  4      4      p	VP                  V	4       VP                  VP                  4       W9  g   Kf  VP                  P                  4       WY&   K  	  ^ .\        V4      ,          p
R.\        V4      ,          p. p\        \        WvW4      4      W\3# )zG
Convert string *s* to vertices and codes using the provided ttf font.
g      ?)r   r   layoutr1   	ft_objectordcharappendr+   get_pathlenlistzip)r   r"   r=   rR   return_new_glyphs_onlyglyph_map_new
xpositions	glyph_idsitemchar_id
ypositionssizesrS   s   &&&&&        r   rL   TextToPath.get_glyphs_with_font   s     #I!'MM%M
	!((1D''DIIGGW%dff%')-)@)@)B& 2 S3z?*
s:&S
BC& 	&r   c                f   VP                  4       pVP                  V P                  4       V P                  P	                  W P
                  V4      w  rVrxp	V'       g   \        4       pV'       d   \        4       p
MTp
. p. p. p. pV F  w  pppppV P                  VV4      pVV9  dk   VP                  4        VP                  V P                  V P
                  4       VP                  V\        P                  R7       VP                  4       V
V&   VP                  V4       VP                  V4       VP                  V4       VV P                  ,          pVP                  V4       K  	  . pV	 F  w  ppppVV3VVV,           3VV,           VV,           3VV,           V3VV3R.p\        P                  \        P                   \        P                   \        P                   \        P                   \        P"                  .pVP                  VV34       K  	  \%        \'        WW4      4      V
V3# )zG
Parse mathtext string *s* and convert it to a (vertices, codes) pair.
r5   r   r   )r9   r   r   r   r-   r   r   r1   clear	load_charr	   r&   rc   rb   r   MOVETOLINETO	CLOSEPOLYre   rf   )r   r    r=   rR   rg   rA   rB   rC   glyphsrS   rh   ri   rm   rj   rn   r"   r?   r0   oxoyrl   sizemyrectsrE   rF   vert1code1s   &&&&&                      r   rM   TextToPath.get_glyphs_mathtext   s    yy{doo&040D0D0J0Jxx1-w #I!'MM%M

	-3)D(E2r''e4Gi'

dootxx8uI,@,@A)-g&b!b!W%doo-DLL .4 !LBAq"XBF|b1fb1f-=1fb\B8V5E[[[[$++t{{DKK^^%E NNE5>* " S
BCw( 	(r   c                6   \        4       P                  W P                  4      p\        P                  ! WPP
                  4      ;_uu_ 4       pVw  pRRR4       Vf   \        4       pV'       d   \        4       pMTp. . . . 3w  rrXP                   EF  p\        VP                  4      pV P                  WP                  4      pW9  d   VP                  4        VP                  V P                  V P
                  4       VP                  p\        V\         4      '       d4   VP#                  V4      pVP%                  V\&        P(                  R7       MX\        V\*        4      '       d4   V P-                  V4       VP/                  V\&        P(                  R7       M\1        RV: 24      hVP3                  4       W&   V	P5                  V4       V
P5                  VP6                  4       VP5                  VP8                  4       VP5                  VP:                  V P                  ,          4       EK  	  . pVP<                   F  w  ppppVV3VV,           V3VV,           VV,           3VVV,           3VV3R.p\>        P@                  \>        PB                  \>        PB                  \>        PB                  \>        PB                  \>        PD                  .pVP5                  VV34       K  	  \G        \I        WW4      4      VV3#   + '       g   i     EL; i)z?Convert the string *s* to vertices and codes using usetex mode.Nr5   zGlyph spec of unexpected type: rq   )%r   make_dvir   r   Dvir   r   textr   	font_pathr1   glyphrr   r   glyph_name_or_index
isinstancestrget_name_index
load_glyphr	   TARGET_LIGHTint_select_native_charmaprs   	TypeErrorrc   rb   r+   y	font_sizeboxesr   rt   ru   rv   re   rf   )r   r    r=   rR   rg   dvifiledvipagerh   rj   ri   rm   rn   r   r"   rl   r   indexr{   rx   ry   rF   rE   r|   r}   s   &&&&&                    r   rK   TextToPath.get_glyphs_tex   sx   
 ,''??;[[((++sED , #I!'MM%M35r2r>0	z IIDDNN+D''jj9G'

dootxx8&*&>&>#1377 //0CDEOOE1G1GOH 3S99//5NN+93I3I # K $&E':&=%? @ @)-&W%dff%dff%LL$//9:- 0  JJLBAq"XQ|b1fb1f-="q&\B8V5E[[[[$++t{{DKK^^%E NNE5>* ' S
BCw( 	(c ,++s   LL	c                    R F  p V P                  V4        R# 	  \        P	                  RV P
                  4       R#   \        \        3 d     KP  i ; i)CBDAz#No supported encoding in font (%s).N)r   iBODA)select_charmap
ValueErrorRuntimeError_logwarningfname)r"   charmap_codes   & r   r   !TextToPath._select_native_charmap  sT    
L##L1 
 LL>

K - s   ?AA)r   r   )F)NF)__name__
__module____qualname____firstlineno____doc__r   r   r   r#   r'   r1   r8   r[   rL   rM   rK   staticmethodr   __static_attributes____classdictcell__)__classdict__s   @r   r   r      sY     1J
C $G/0:x&>1(f8(t L Lr   r   c                   l   a a ] tR tRt oRtR
V 3R lltR tR t]R 4       t	]R 4       t
R tR	tVtV ;t# )TextPathi%  z
Create a path from the text.
c                4  < ^ RI Hp \        P                  ! V4      pVf   VP	                  4       pWn        V P                  V4       RV n        V! VR7      P                  V4      w  r(\        S	V `(  ! \        P                  WBVR7      RVRR/  RV n        R# )	a
  
Create a path from the text. Note that it simply is a path,
not an artist. You need to use the `.PathPatch` (or other artists)
to draw this path onto the canvas.

Parameters
----------
xy : tuple or array of two float values
    Position of the text. For no offset, use ``xy=(0, 0)``.

s : str
    The text to convert to a path.

size : float, optional
    Font size in points. Defaults to the size specified via the font
    properties *prop*.

prop : `~matplotlib.font_manager.FontProperties`, optional
    Font property. If not provided, will use a default
    `.FontProperties` with parameters from the
    :ref:`rcParams<customizing-with-dynamic-rc-settings>`.

_interpolation_steps : int, optional
    (Currently ignored)

usetex : bool, default: False
    Whether to use tex rendering.

Examples
--------
The following creates a path from the string "ABC" with Helvetica
font face; and another path from the latex fraction 1/2::

    from matplotlib.text import TextPath
    from matplotlib.font_manager import FontProperties

    fp = FontProperties(family="Helvetica", style="italic")
    path1 = TextPath((12, 12), "ABC", size=12, prop=fp)
    path2 = TextPath((0, 0), r"$\frac{1}{2}$", size=12, usetex=True)

Also see :doc:`/gallery/text_labels_and_annotations/demo_text_path`.
)TextN)usetex)r>   _interpolation_stepsreadonlyTF)matplotlib.textr   r   	_from_anyr7   _xyr   _cached_vertices_preprocess_mathsuperr   text_to_pathr[   _should_simplify)
r   xyr=   rz   r    r   r   r   r>   	__class__s
   &&&&&&&  r   r   TextPath.__init__*  s    Z 	)''-<**,Dd $'88;	'''?	!5	 	 !&r   c                     Wn         RV n        R# )zSet the text size.TN)_size_invalid)r   rz   s   &&r   r   TextPath.set_sizeh  s    
r   c                    V P                   # )zGet the text size.)r   r   s   &r   get_sizeTextPath.get_sizem  s    zzr   c                :    V P                  4        V P                  # )z8
Return the cached path after updating it if necessary.
)_revalidate_pathr   r   s   &r   verticesTextPath.verticesq  s    
 	$$$r   c                    V P                   # )z
Return the codes
)_codesr   s   &r   rU   TextPath.codesy  s    
 {{r   c                n   V P                   '       g   V P                  f   \        4       P                  V P                  \
        P                  ,          4      P                  ! V P                  !  pVP                  V P                  4      V n        RV P                  P                  n        RV n         R# R# )z
Update the path if necessary.

The path for the text is initially create with the font size of
`.FONT_SCALE`, and this path is rescaled to other size when necessary.
NF)r   r   r   r@   r   r   r   	translater   	transform	_verticesr6   	writeable)r   trs   & r   r   TextPath._revalidate_path  s     ===D119*5l&=&==>9"hh(B %'LL$@D!49D!!''1!DM :r   )r   r   r   r   r   )NN   F)r   r   r   r   r   r   r   r   propertyr   rU   r   r   r   __classcell__)r   r   s   @@r   r   r   %  sL     <&|
 % %  " "r   r   )collectionsr   loggingurllib.parser,   numpyrO   
matplotlibr   r   matplotlib.font_managerr   r   r   r   matplotlib.ft2fontr	   matplotlib.mathtextr
   matplotlib.pathr   matplotlib.texmanagerr   matplotlib.transformsr   	getLoggerr   r   r   r   r    r   r   <module>r      se    #    -  ) .   , *"KL KL\ |h"t h"r   