You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<spanid="matplotlib-font-manager"></span><h2><aclass="reference internal" href="#module-matplotlib.font_manager" title="matplotlib.font_manager"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.font_manager</span></code></a><aclass="headerlink" href="#module-matplotlib.font_manager" title="Permalink to this headline">¶</a></h2>
<p>A module for finding, managing, and using fonts across platforms.</p>
<p>This module provides a single <aclass="reference internal" href="#matplotlib.font_manager.FontManager" title="matplotlib.font_manager.FontManager"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FontManager</span></code></a> instance that can
be shared across backends and platforms. The <aclass="reference internal" href="#matplotlib.font_manager.findfont" title="matplotlib.font_manager.findfont"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">findfont()</span></code></a>
function returns the best TrueType (TTF) font file in the local or
system font path that matches the specified <aclass="reference internal" href="#matplotlib.font_manager.FontProperties" title="matplotlib.font_manager.FontProperties"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FontProperties</span></code></a>
instance. The <aclass="reference internal" href="#matplotlib.font_manager.FontManager" title="matplotlib.font_manager.FontManager"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FontManager</span></code></a> also handles Adobe Font Metrics
(AFM) font files for use by the PostScript backend.</p>
<p>The design is based on the <aclass="reference external" href="http://www.w3.org/TR/1998/REC-CSS2-19980512/">W3C Cascading Style Sheet, Level 1 (CSS1)
font specification</a>.
Future versions may implement the Level 2 or 2.1 specifications.</p>
<p>Experimental support is included for using <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">fontconfig</span></code> on Unix
variant platforms (Linux, OS X, Solaris). To enable it, set the
constant <codeclass="docutils literal notranslate"><spanclass="pre">USE_FONTCONFIG</span></code> in this file to <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>. Fontconfig has
the advantage that it is the standard way to look up fonts on X11
platforms, so if a font is installed, it is much more likely to be
found.</p>
<dlclass="class">
<dtid="matplotlib.font_manager.FontEntry">
<emclass="property">class </em><codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">FontEntry</code><spanclass="sig-paren">(</span><em>fname=''</em>, <em>name=''</em>, <em>style='normal'</em>, <em>variant='normal'</em>, <em>weight='normal'</em>, <em>stretch='normal'</em>, <em>size='medium'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontEntry"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontEntry" title="Permalink to this definition">¶</a></dt>
<p>A class for storing Font properties. It is used when populating
the font lookup dictionary.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.font_manager.FontManager">
<emclass="property">class </em><codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">FontManager</code><spanclass="sig-paren">(</span><em>size=None</em>, <em>weight='normal'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">findfont</code><spanclass="sig-paren">(</span><em>prop</em>, <em>fontext='ttf'</em>, <em>directory=None</em>, <em>fallback_to_default=True</em>, <em>rebuild_if_missing=True</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.findfont"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.findfont" title="Permalink to this definition">¶</a></dt>
<dd><p>Search the font list for the font that most closely matches
the <aclass="reference internal" href="#matplotlib.font_manager.FontProperties" title="matplotlib.font_manager.FontProperties"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">FontProperties</span></code></a><em>prop</em>.</p>
<p><aclass="reference internal" href="#matplotlib.font_manager.findfont" title="matplotlib.font_manager.findfont"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">findfont()</span></code></a> performs a nearest neighbor search. Each
font is given a similarity score to the target font
properties. The first font with the highest score is
returned. If no matches below a certain threshold are found,
the default font (usually DejaVu Sans) is returned.</p>
<p><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">directory</span></code>, is specified, will only return fonts from the
given directory (or subdirectory of that directory).</p>
<p>The result is cached, so subsequent lookups don’t have to
perform the O(n) nearest neighbor search.</p>
<p>If <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">fallback_to_default</span></code> is True, will fallback to the default
font family (usually “DejaVu Sans” or “Helvetica”) if
<emclass="property">static </em><codeclass="descname">get_default_size</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.get_default_size"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.get_default_size" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_default_weight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.get_default_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.get_default_weight" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">score_family</code><spanclass="sig-paren">(</span><em>families</em>, <em>family2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_family"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_family" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between the list of font families in
<em>families</em> and the font family name <em>family2</em>.</p>
<p>An exact match at the head of the list returns 0.0.</p>
<p>A match further down the list will return between 0 and 1.</p>
<codeclass="descname">score_size</code><spanclass="sig-paren">(</span><em>size1</em>, <em>size2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_size"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between <em>size1</em> and <em>size2</em>.</p>
<p>If <em>size2</em> (the size specified in the font file) is ‘scalable’, this
function always returns 0.0, since any font size can be generated.</p>
<p>Otherwise, the result is the absolute distance between <em>size1</em> and
<em>size2</em>, normalized so that the usual range of font sizes (6pt -
<codeclass="descname">score_stretch</code><spanclass="sig-paren">(</span><em>stretch1</em>, <em>stretch2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_stretch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_stretch" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between <em>stretch1</em> and <em>stretch2</em>.</p>
<p>The result is the absolute value of the difference between the
CSS numeric values of <em>stretch1</em> and <em>stretch2</em>, normalized
<codeclass="descname">score_style</code><spanclass="sig-paren">(</span><em>style1</em>, <em>style2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_style"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_style" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between <em>style1</em> and <em>style2</em>.</p>
<p>An exact match returns 0.0.</p>
<p>A match between ‘italic’ and ‘oblique’ returns 0.1.</p>
<codeclass="descname">score_variant</code><spanclass="sig-paren">(</span><em>variant1</em>, <em>variant2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_variant"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_variant" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between <em>variant1</em> and <em>variant2</em>.</p>
<codeclass="descname">score_weight</code><spanclass="sig-paren">(</span><em>weight1</em>, <em>weight2</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.score_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.score_weight" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a match score between <em>weight1</em> and <em>weight2</em>.</p>
<p>The result is 0.0 if both weight1 and weight 2 are given as strings
and have the same value.</p>
<p>Otherwise, the result is the absolute value of the difference between the
CSS numeric values of <em>weight1</em> and <em>weight2</em>, normalized
<codeclass="descname">set_default_weight</code><spanclass="sig-paren">(</span><em>weight</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.set_default_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.set_default_weight" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the default font weight. The initial value is ‘normal’.</p>
<codeclass="descname">update_fonts</code><spanclass="sig-paren">(</span><em>filenames</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontManager.update_fonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontManager.update_fonts" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the font dictionary with new font files.
Currently not implemented.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.font_manager.FontProperties">
<emclass="property">class </em><codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">FontProperties</code><spanclass="sig-paren">(</span><em>family=None</em>, <em>style=None</em>, <em>variant=None</em>, <em>weight=None</em>, <em>stretch=None</em>, <em>size=None</em>, <em>fname=None</em>, <em>_init=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties" title="Permalink to this definition">¶</a></dt>
<p>Alternatively, a font may be specified using an absolute path to a
.ttf file, by using the <em>fname</em> kwarg.</p>
<p>The preferred usage of font sizes is to use the relative values,
e.g., ‘large’, instead of absolute font sizes, e.g., 12. This
approach allows all text sizes to be made larger or smaller based
on the font manager’s default font size.</p>
<p>This class will also accept a <aclass="reference external" href="https://www.freedesktop.org/wiki/Software/fontconfig/">fontconfig</a> pattern, if it is
the only argument provided. See the documentation on <aclass="reference external" href="https://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig patterns</a>.
This support does not require fontconfig to be installed. We are merely
borrowing its pattern syntax for use here.</p>
<p>Note that matplotlib’s internal font manager and fontconfig use a
different algorithm to lookup fonts, so the results of the same pattern
may be different in matplotlib than in other applications that use
<codeclass="descname">copy</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.copy"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.copy" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_family</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_family"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_family" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of font names that comprise the font family.</p>
<codeclass="descname">get_file</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the filename of the associated font.</p>
<codeclass="descname">get_fontconfig_pattern</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_fontconfig_pattern"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_fontconfig_pattern" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a fontconfig pattern suitable for looking up the font as
specified with fontconfig’s <codeclass="docutils literal notranslate"><spanclass="pre">fc-match</span></code> utility.</p>
<p>See the documentation on <aclass="reference external" href="https://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig patterns</a>.</p>
<p>This support does not require fontconfig to be installed or
support for it to be enabled. We are merely borrowing its
<codeclass="descname">get_name</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_name"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the name of the font that best matches the font
<codeclass="descname">get_size</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_size"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_size" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_size_in_points</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_size_in_points"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_size_in_points" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_slant</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_slant" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font style. Values are: ‘normal’, ‘italic’ or
<codeclass="descname">get_stretch</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_stretch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_stretch" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font stretch or width. Options are: ‘ultra-condensed’,
<codeclass="descname">get_style</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_style"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_style" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font style. Values are: ‘normal’, ‘italic’ or
<codeclass="descname">get_variant</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_variant"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_variant" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font variant. Values are: ‘normal’ or
<codeclass="descname">get_weight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.get_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.get_weight" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font weight. Options are: A numeric value in the
range 0-1000 or one of ‘light’, ‘normal’, ‘regular’, ‘book’,
<codeclass="descname">set_family</code><spanclass="sig-paren">(</span><em>family</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_family"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_family" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the font family. May be either an alias (generic name
is CSS parlance), such as: ‘serif’, ‘sans-serif’, ‘cursive’,
‘fantasy’, or ‘monospace’, a real font name or a list of real
font names. Real font names are not supported when
<codeclass="descname">set_file</code><spanclass="sig-paren">(</span><em>file</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the filename of the fontfile to use. In this case, all
<codeclass="descname">set_fontconfig_pattern</code><spanclass="sig-paren">(</span><em>pattern</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_fontconfig_pattern"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_fontconfig_pattern" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the properties by parsing a fontconfig <em>pattern</em>.</p>
<p>See the documentation on <aclass="reference external" href="https://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig patterns</a>.</p>
<p>This support does not require fontconfig to be installed or
support for it to be enabled. We are merely borrowing its
<codeclass="descname">set_name</code><spanclass="sig-paren">(</span><em>family</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the font family. May be either an alias (generic name
is CSS parlance), such as: ‘serif’, ‘sans-serif’, ‘cursive’,
‘fantasy’, or ‘monospace’, a real font name or a list of real
font names. Real font names are not supported when
<codeclass="descname">set_size</code><spanclass="sig-paren">(</span><em>size</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_size"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font size. Either an relative value of ‘xx-small’,
<codeclass="descname">set_slant</code><spanclass="sig-paren">(</span><em>style</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_slant" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font style. Values are: ‘normal’, ‘italic’ or
<codeclass="descname">set_stretch</code><spanclass="sig-paren">(</span><em>stretch</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_stretch"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_stretch" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font stretch or width. Options are: ‘ultra-condensed’,
<codeclass="descname">set_style</code><spanclass="sig-paren">(</span><em>style</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_style"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_style" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font style. Values are: ‘normal’, ‘italic’ or
<codeclass="descname">set_variant</code><spanclass="sig-paren">(</span><em>variant</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_variant"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_variant" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font variant. Values are: ‘normal’ or ‘small-caps’.</p>
<codeclass="descname">set_weight</code><spanclass="sig-paren">(</span><em>weight</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#FontProperties.set_weight"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.FontProperties.set_weight" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the font weight. May be either a numeric value in the
range 0-1000 or one of ‘ultralight’, ‘light’, ‘normal’,
<codeclass="descname">default</code><spanclass="sig-paren">(</span><em>o</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#JSONEncoder.default"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.JSONEncoder.default" title="Permalink to this definition">¶</a></dt>
<dd><p>Implement this method in a subclass such that it returns
a serializable object for <codeclass="docutils literal notranslate"><spanclass="pre">o</span></code>, or calls the base implementation
(to raise a <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code>).</p>
<p>For example, to support arbitrary iterators, you could
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">OSXInstalledFonts</code><spanclass="sig-paren">(</span><em>directories=None</em>, <em>fontext='ttf'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#OSXInstalledFonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.OSXInstalledFonts" title="Permalink to this definition">¶</a></dt>
<dd><p>Get list of font files on OS X - ignores font suffix by default.</p>
</dd></dl>
<dlclass="class">
<dtid="matplotlib.font_manager.TempCache">
<emclass="property">class </em><codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">TempCache</code><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#TempCache"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.TempCache" title="Permalink to this definition">¶</a></dt>
<p>A class to store temporary caches that are (a) not saved to disk
and (b) invalidated whenever certain font-related
rcParams—namely the family lookup lists—are changed or the
font cache is reloaded. This avoids the expensive linear search
through all fonts every time a font is looked up.</p>
<dlclass="method">
<dtid="matplotlib.font_manager.TempCache.get">
<codeclass="descname">get</code><spanclass="sig-paren">(</span><em>prop</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#TempCache.get"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.TempCache.get" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">make_rcparams_key</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#TempCache.make_rcparams_key"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.TempCache.make_rcparams_key" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.font_manager.TempCache.set">
<codeclass="descname">set</code><spanclass="sig-paren">(</span><em>prop</em>, <em>value</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#TempCache.set"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.TempCache.set" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.afmFontProperty">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">afmFontProperty</code><spanclass="sig-paren">(</span><em>fontpath</em>, <em>font</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#afmFontProperty"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.afmFontProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract information from an AFM font file.</p>
<dd><pclass="first last">The AFM font file from which information will be extracted.</p>
</dd>
</dl>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><dlclass="first last docutils">
<dt><strong>`FontEntry`</strong></dt>
<dd><pclass="first last">The extracted font properties.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.createFontList">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">createFontList</code><spanclass="sig-paren">(</span><em>fontfiles</em>, <em>fontext='ttf'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#createFontList"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.createFontList" title="Permalink to this definition">¶</a></dt>
<dd><p>A function to create a font lookup list. The default is to create
a list of TrueType fonts. An AFM font list can optionally be
created.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.findSystemFonts">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">findSystemFonts</code><spanclass="sig-paren">(</span><em>fontpaths=None</em>, <em>fontext='ttf'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#findSystemFonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.findSystemFonts" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for fonts in the specified font paths. If no paths are
given, will use a standard set of system paths, as well as the
list of fonts tracked by fontconfig if fontconfig is installed and
available. A list of TrueType fonts are returned by default with
AFM fonts as an option.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.findfont">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">findfont</code><spanclass="sig-paren">(</span><em>prop</em>, <em>**kw</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#findfont"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.findfont" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.get_font">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">get_font</code><spanclass="sig-paren">(</span><em>filename</em>, <em>hinting_factor=None</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#get_font"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.get_font" title="Permalink to this definition">¶</a></dt>
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">get_fontconfig_fonts</code><spanclass="sig-paren">(</span><em>fontext='ttf'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#get_fontconfig_fonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.get_fontconfig_fonts" title="Permalink to this definition">¶</a></dt>
<dd><p>List the font filenames known to <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">fc-list</span></code> having the given extension.</p>
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">get_fontext_synonyms</code><spanclass="sig-paren">(</span><em>fontext</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#get_fontext_synonyms"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.get_fontext_synonyms" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of file extensions extensions that are synonyms for
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">is_opentype_cff_font</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#is_opentype_cff_font"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.is_opentype_cff_font" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if the given font is a Postscript Compact Font Format
Font embedded in an OpenType wrapper. Used by the PostScript and
PDF backends that can not subset these fonts.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.json_dump">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">json_dump</code><spanclass="sig-paren">(</span><em>data</em>, <em>filename</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#json_dump"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.json_dump" title="Permalink to this definition">¶</a></dt>
<dd><p>Dumps a data structure as JSON in the named file.
Handles FontManager and its fields.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.json_load">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">json_load</code><spanclass="sig-paren">(</span><em>filename</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#json_load"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.json_load" title="Permalink to this definition">¶</a></dt>
<dd><p>Loads a data structure as JSON from the named file.
Handles FontManager and its fields.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.list_fonts">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">list_fonts</code><spanclass="sig-paren">(</span><em>directory</em>, <em>extensions</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#list_fonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.list_fonts" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of all fonts matching any of the extensions,
possibly upper-cased, found recursively under the directory.</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.ttfFontProperty">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">ttfFontProperty</code><spanclass="sig-paren">(</span><em>font</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#ttfFontProperty"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.ttfFontProperty" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract information from a TrueType font file.</p>
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">ttfdict_to_fnames</code><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#ttfdict_to_fnames"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.ttfdict_to_fnames" title="Permalink to this definition">¶</a></dt>
<dd><divclass="deprecated">
<p><spanclass="versionmodified">Deprecated since version 2.1: </span>The ttfdict_to_fnames function was deprecated in version 2.1.</p>
</div>
<p>flatten a ttfdict to all the filenames it contains</p>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.font_manager.weight_as_number">
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">weight_as_number</code><spanclass="sig-paren">(</span><em>weight</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#weight_as_number"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.weight_as_number" title="Permalink to this definition">¶</a></dt>
<dd><divclass="deprecated">
<p><spanclass="versionmodified">Deprecated since version 2.1: </span>The weight_as_number function was deprecated in version 2.1.</p>
</div>
<p>Return the weight property as a numeric value. String values
are converted to their corresponding numeric value.</p>
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">win32FontDirectory</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#win32FontDirectory"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.win32FontDirectory" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the user-specified font directory for Win32. This is
<codeclass="descclassname">matplotlib.font_manager.</code><codeclass="descname">win32InstalledFonts</code><spanclass="sig-paren">(</span><em>directory=None</em>, <em>fontext='ttf'</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/font_manager.html#win32InstalledFonts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.font_manager.win32InstalledFonts" title="Permalink to this definition">¶</a></dt>
<dd><p>Search for fonts in the specified font directory, or use the
system directories if none given. A list of TrueType font
filenames are returned by default, or AFM fonts if <em>fontext</em> ==
<spanid="matplotlib-fontconfig-pattern"></span><h2><aclass="reference internal" href="#module-matplotlib.fontconfig_pattern" title="matplotlib.fontconfig_pattern"><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.fontconfig_pattern</span></code></a><aclass="headerlink" href="#module-matplotlib.fontconfig_pattern" title="Permalink to this headline">¶</a></h2>
<p>A module for parsing and generating fontconfig patterns.</p>
<p>See the <aclass="reference external" href="https://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig pattern specification</a> for
<emclass="property">class </em><codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">FontconfigPatternParser</code><aclass="reference internal" href="../_modules/matplotlib/fontconfig_pattern.html#FontconfigPatternParser"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.fontconfig_pattern.FontconfigPatternParser" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">parse</code><spanclass="sig-paren">(</span><em>pattern</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/fontconfig_pattern.html#FontconfigPatternParser.parse"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.fontconfig_pattern.FontconfigPatternParser.parse" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the given fontconfig <em>pattern</em> and return a dictionary
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">family_escape</code><spanclass="sig-paren">(</span><em>$self</em>, <em>/</em>, <em>repl</em>, <em>string</em>, <em>count=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.fontconfig_pattern.family_escape" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">family_unescape</code><spanclass="sig-paren">(</span><em>$self</em>, <em>/</em>, <em>repl</em>, <em>string</em>, <em>count=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.fontconfig_pattern.family_unescape" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">generate_fontconfig_pattern</code><spanclass="sig-paren">(</span><em>d</em><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/fontconfig_pattern.html#generate_fontconfig_pattern"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.fontconfig_pattern.generate_fontconfig_pattern" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a dictionary of key/value pairs, generates a fontconfig
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">parse_fontconfig_pattern</code><aclass="headerlink" href="#matplotlib.fontconfig_pattern.parse_fontconfig_pattern" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the given fontconfig <em>pattern</em> and return a dictionary
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">value_escape</code><spanclass="sig-paren">(</span><em>$self</em>, <em>/</em>, <em>repl</em>, <em>string</em>, <em>count=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.fontconfig_pattern.value_escape" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
<codeclass="descclassname">matplotlib.fontconfig_pattern.</code><codeclass="descname">value_unescape</code><spanclass="sig-paren">(</span><em>$self</em>, <em>/</em>, <em>repl</em>, <em>string</em>, <em>count=0</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.fontconfig_pattern.value_unescape" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>