class_docstr: Point pen used for drawing to a TrueType glyph.
  
  This pen can be used to construct or modify glyphs in a TrueType format
  font. After using the pen to draw, use the ``.glyph()`` method to retrieve
  a :py:class:`~._g_l_y_f.Glyph` object representing the glyph.
class_docstr_tok: ["Point","pen","used","for","drawing","to","a","TrueType","glyph",".","This","pen","can","be","used","to","construct","or","modify","glyphs","in","a","TrueType","format","font",".","After","using","the","pen","to","draw",",","use","the","``",".glyph","(",")","``","method","to","retrieve","a",":","py",":","class",":","`","~._g_l_y_f.Glyph","`","object","representing","the","glyph","."]
docstr: End the current sub path.
docstr_tok: ["End","the","current","sub","path","."]
code: def endPath(self) -> None:
      """
      End the current sub path.
      """
      # TrueType contours are always "closed"
      if self._isClosed():
          raise PenError("Contour is already closed.")
      if self._currentContourStartIndex == len(self.points):
          # ignore empty contours
          self._currentContourStartIndex = None
          return
  
      contourStart = self.endPts[-1] + 1 if self.endPts else 0
      self.endPts.append(len(self.points) - 1)
      self._currentContourStartIndex = None
  
      # Resolve types for any cubic segments
      flags = self.types
      for i in range(contourStart, len(flags)):
          if flags[i] == "curve":
              j = i - 1
              if j < contourStart:
                  j = len(flags) - 1
              while flags[j] == 0:
                  flags[j] = flagCubic
                  j -= 1
              flags[i] = flagOnCurve
  
imports: from array import array
  from typing import Any, Callable, Dict, Optional, Tuple
  from fontTools.misc.fixedTools import MAX_F2DOT14, floatToFixedToFloat
  from fontTools.misc.loggingTools import LogMixin
  from fontTools.pens.pointPen import AbstractPointPen
  from fontTools.misc.roundTools import otRound
  from fontTools.pens.basePen import LoggingPen, PenError
  from fontTools.pens.transformPen import TransformPen, TransformPointPen
  from fontTools.ttLib.tables import ttProgram
  from fontTools.ttLib.tables._g_l_y_f import flagOnCurve, flagCubic
  from fontTools.ttLib.tables._g_l_y_f import Glyph
  from fontTools.ttLib.tables._g_l_y_f import GlyphComponent
  from fontTools.ttLib.tables._g_l_y_f import GlyphCoordinates
  from fontTools.ttLib.tables._g_l_y_f import dropImpliedOnCurvePoints
  import math
label_desc: Use image node_id 4 for calling the TTGlyphPointPen obj's underlying member method code with example usage: obj.endPath() without return types