MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _height_depth_of

Method _height_depth_of

lib/matplotlib/dviread.py:751–768  ·  view source on GitHub ↗

Height and depth of char in dvi units.

(self, char)

Source from the content-addressed store, hash-verified

749 return _mul1220(metrics.tex_width, self._scale)
750
751 def _height_depth_of(self, char):
752 """Height and depth of char in dvi units."""
753 metrics = self._metrics.get_metrics(char)
754 if metrics is None:
755 _log.debug('No metrics for char %d in font %s', char, self.texname)
756 return [0, 0]
757 hd = [
758 _mul1220(metrics.tex_height, self._scale),
759 _mul1220(metrics.tex_depth, self._scale),
760 ]
761 # cmsyXX (symbols font) glyph 0 ("minus") has a nonzero descent
762 # so that TeX aligns equations properly
763 # (https://tex.stackexchange.com/q/526103/)
764 # but we actually care about the rasterization depth to align
765 # the dvipng-generated images.
766 if re.match(br'^cmsy\d+$', self.texname) and char == 0:
767 hd[-1] = 0
768 return hd
769
770 def resolve_path(self):
771 if self._path is None:

Callers 1

_outputMethod · 0.80

Calls 2

_mul1220Function · 0.85
get_metricsMethod · 0.45

Tested by

no test coverage detected