class_docstr: Create a path from the text.
class_docstr_tok: ["Create","a","path","from","the","text","."]
docstr: 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`.
docstr_tok: ["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","`","."]
code: def __init__(
      self,
      xy,
      s,
      size=None,
      prop=None,
      _interpolation_steps=1,
      usetex=False,
  ):
      r"""
      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`.
      """
      # Circular import.
      from matplotlib.text import Text
  
      prop = FontProperties._from_any(prop)
      if size is None:
          size = prop.get_size_in_points()
  
      self._xy = xy
      self.set_size(size)
  
      self._cached_vertices = None
      s, ismath = Text(usetex=usetex)._preprocess_math(s)
      super().__init__(
          *text_to_path.get_text_path(prop, s, ismath=ismath),
          _interpolation_steps=_interpolation_steps,
          readonly=True,
      )
      self._should_simplify = False
  
imports: from collections import OrderedDict
  import logging
  import urllib.parse
  import numpy
  from matplotlib import _text_helpers, dviread
  from matplotlib.font_manager import FontProperties, get_font, fontManager
  from matplotlib.ft2font import LOAD_NO_HINTING, LOAD_TARGET_LIGHT
  from matplotlib.mathtext import MathTextParser
  from matplotlib.path import Path
  from matplotlib.texmanager import TexManager
  from matplotlib.transforms import Affine2D
label_desc: Use image node_id 1 to create a new TextPath object from inherited base classes: Path with example: obj = TextPath(xy, s, size, prop, _interpolation_steps, usetex)