class_docstr: Convert strings to dvi files using TeX, caching the results to a directory.
  
  The cache directory is called ``tex.cache`` and is located in the directory
  returned by `.get_cachedir`.
  
  Repeated calls to this constructor always return the same instance.
class_docstr_tok: ["Convert","strings","to","dvi","files","using","TeX",",","caching","the","results","to","a","directory",".","The","cache","directory","is","called","``","tex.cache","``","and","is","located","in","the","directory","returned","by","`",".get_cachedir","`",".","Repeated","calls","to","this","constructor","always","return","the","same","instance","."]
docstr: Return width, height and descent of the text.
docstr_tok: ["Return","width",",","height","and","descent","of","the","text","."]
code: def get_text_width_height_descent(cls, tex, fontsize, renderer=None):
      """Return width, height and descent of the text."""
      if tex.strip() == "":
          return 0, 0, 0
      dvifile = cls.make_dvi(tex, fontsize)
      dpi_fraction = renderer.points_to_pixels(1.0) if renderer else 1
      with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
          (page,) = dvi
      # A total height (including the descent) needs to be returned.
      return page.width, page.height + page.descent, page.descent
  
imports: import functools
  import hashlib
  import logging
  import os
  from pathlib import Path
  import subprocess
  from tempfile import TemporaryDirectory
  import numpy
  import matplotlib
  from matplotlib import _api, cbook, dviread
label_desc: Use image node_id 14 for calling the TexManager obj's underlying member method code with example usage: obj.get_text_width_height_descent(cls, tex, fontsize, renderer) and returns: page,  unknown,  page, int,  int,  int