title: changing font in matplotlib
body: <p>im trying to render math equations using matplotlib but i can't change the font to Fira Code(Nerd Font).</p>
  <pre class="lang-py prettyprint-override"><code>from matplotlib import mathtext, font_manager
  import matplotlib as mpl
  mpl.rcParams['savefig.transparent'] = True
  mpl.rcParams['text.color'] = &quot;white&quot;
  
  #texFont = font_manager.FontProperties(size=30, fname=&quot;./OpenSans-Medium.ttf&quot;)
  texFont = font_manager.FontProperties(size=30, family='serif', math_fontfamily='cm')
  
  mathtext.math_to_image(
      r&quot;&quot;&quot;Sum of zeroes: $\alpha + \beta  $
      Some text&quot;&quot;&quot;,
      &quot;output.png&quot;,
      prop=texFont,
      dpi=300,
      format='png'
  )
  </code></pre>
  <p>I also get this statement when i run the code</p>
  <p><code>Font 'default' does not have a glyph for '\n' [U+a], substituting with a dummy symbol.</code></p>
  <p>how do i fix this?</p>
  <p><strong>output.png</strong>
  <a href="https://i.stack.imgur.com/knU5R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/knU5R.png" alt="output.png" /></a></p>