class_docstr: A cell is a `.Rectangle` with some associated `.Text`.
  
  As a user, you'll most likely not creates cells yourself. Instead, you
  should use either the `~matplotlib.table.table` factory function or
  `.Table.add_cell`.
class_docstr_tok: ["A","cell","is","a","`",".Rectangle","`","with","some","associated","`",".Text","`",".","As","a","user",",","you","'ll","most","likely","not","creates","cells","yourself",".","Instead",",","you","should","use","either","the","`","~matplotlib.table.table","`","factory","function","or","`",".Table.add_cell","`","."]
docstr: Shrink font size until the text fits into the cell width.
docstr_tok: ["Shrink","font","size","until","the","text","fits","into","the","cell","width","."]
code: def auto_set_font_size(self, renderer):
      """Shrink font size until the text fits into the cell width."""
      fontsize = self.get_fontsize()
      required = self.get_required_width(renderer)
      while fontsize > 1 and required > self.get_width():
          fontsize -= 1
          self.set_fontsize(fontsize)
          required = self.get_required_width(renderer)
  
      return fontsize
  
imports: import numpy
  from .None import _api, _docstring
  from .artist import Artist, allow_rasterization
  from .patches import Rectangle
  from .text import Text
  from .transforms import Bbox
  from .path import Path
label_desc: Use image node_id 7 for calling the Cell obj's underlying member method code with example usage: obj.auto_set_font_size(renderer) and returns: fontsize