<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.3). For the latest version see <ahref="https://matplotlib.org/stable/api/afm_api.html">https://matplotlib.org/stable/api/afm_api.html</a></div>
<spanclass="gp">>>> </span><spanclass="n">afm</span><spanclass="o">.</span><spanclass="n">string_width_height</span><spanclass="p">(</span><spanclass="s1">'What the heck?'</span><spanclass="p">)</span>
<emclass="property">class </em><codeclass="descclassname">matplotlib.afm.</code><codeclass="descname">AFM</code><spanclass="sig-paren">(</span><em>fh</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM" title="Permalink to this definition">¶</a></dt>
<p>Parse the AFM file in file object <em>fh</em></p>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_angle">
<codeclass="descname">get_angle</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_angle" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the fontangle as float</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_bbox_char">
<codeclass="descname">get_bbox_char</code><spanclass="sig-paren">(</span><em>c</em>, <em>isord=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_bbox_char" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_capheight">
<codeclass="descname">get_capheight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_capheight" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the cap height as float</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_familyname">
<codeclass="descname">get_familyname</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_familyname" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font family name, e.g., ‘Times’</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_fontname">
<codeclass="descname">get_fontname</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_fontname" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font name, e.g., ‘Times-Roman’</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_fullname">
<codeclass="descname">get_fullname</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_fullname" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font full name, e.g., ‘Times-Roman’</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_height_char">
<codeclass="descname">get_height_char</code><spanclass="sig-paren">(</span><em>c</em>, <em>isord=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_height_char" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the height of character <em>c</em> from the bounding box. This
<codeclass="descname">get_horizontal_stem_width</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_horizontal_stem_width" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the standard horizontal stem width as float, or <em>None</em> if
not specified in AFM file.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_kern_dist">
<codeclass="descname">get_kern_dist</code><spanclass="sig-paren">(</span><em>c1</em>, <em>c2</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_kern_dist" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the kerning pair distance (possibly 0) for chars <em>c1</em>
<codeclass="descname">get_kern_dist_from_name</code><spanclass="sig-paren">(</span><em>name1</em>, <em>name2</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_kern_dist_from_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the kerning pair distance (possibly 0) for chars
<em>name1</em> and <em>name2</em></p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_name_char">
<codeclass="descname">get_name_char</code><spanclass="sig-paren">(</span><em>c</em>, <em>isord=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_name_char" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the name of the character, i.e., ‘;’ is ‘semicolon’</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_str_bbox">
<codeclass="descname">get_str_bbox</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_str_bbox" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_str_bbox_and_descent</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_str_bbox_and_descent" title="Permalink to this definition">¶</a></dt>
<codeclass="descname">get_underline_thickness</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_underline_thickness" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the underline thickness as float</p>
<codeclass="descname">get_vertical_stem_width</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_vertical_stem_width" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the standard vertical stem width as float, or <em>None</em> if
not specified in AFM file.</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_weight">
<codeclass="descname">get_weight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_weight" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the font weight, e.g., ‘Bold’ or ‘Roman’</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_width_char">
<codeclass="descname">get_width_char</code><spanclass="sig-paren">(</span><em>c</em>, <em>isord=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_width_char" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the width of the character from the character metric WX
<codeclass="descname">get_width_from_char_name</code><spanclass="sig-paren">(</span><em>name</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_width_from_char_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the width of the character from a type1 character name</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.get_xheight">
<codeclass="descname">get_xheight</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.get_xheight" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the xheight as float</p>
</dd></dl>
<dlclass="method">
<dtid="matplotlib.afm.AFM.string_width_height">
<codeclass="descname">string_width_height</code><spanclass="sig-paren">(</span><em>s</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.AFM.string_width_height" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the string width (including kerning) and string height
as a (<em>w</em>, <em>h</em>) tuple.</p>
</dd></dl>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.afm.parse_afm">
<codeclass="descclassname">matplotlib.afm.</code><codeclass="descname">parse_afm</code><spanclass="sig-paren">(</span><em>fh</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.afm.parse_afm" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse the Adobe Font Metics file in file handle <em>fh</em>. Return value
is a (<em>dhead</em>, <em>dcmetrics</em>, <em>dkernpairs</em>, <em>dcomposite</em>) tuple where
<em>dhead</em> is a <codeclass="xref py py-func docutils literal"><spanclass="pre">_parse_header()</span></code> dict, <em>dcmetrics</em> is a
<codeclass="xref py py-func docutils literal"><spanclass="pre">_parse_composites()</span></code> dict, <em>dkernpairs</em> is a
<codeclass="xref py py-func docutils literal"><spanclass="pre">_parse_kern_pairs()</span></code> dict (possibly {}), and <em>dcomposite</em> is a