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

Class Accent

lib/matplotlib/_mathtext.py:1253–1273  ·  view source on GitHub ↗

The font metrics need to be dealt with differently for accents, since they are already offset correctly from the baseline in TrueType fonts.

Source from the content-addressed store, hash-verified

1251
1252
1253class Accent(Char):
1254 """
1255 The font metrics need to be dealt with differently for accents,
1256 since they are already offset correctly from the baseline in
1257 TrueType fonts.
1258 """
1259 def _update_metrics(self) -> None:
1260 metrics = self._metrics = self.fontset.get_metrics(
1261 self.font, self.font_class, self.c, self.fontsize, self.dpi)
1262 self.width = metrics.xmax - metrics.xmin
1263 self.height = metrics.ymax - metrics.ymin
1264 self.depth = 0
1265
1266 def shrink(self) -> None:
1267 super().shrink()
1268 self._update_metrics()
1269
1270 def render(self, output: Output, x: float, y: float) -> None:
1271 self.fontset.render_glyph(
1272 output, x - self._metrics.xmin, y + self._metrics.ymin,
1273 self.font, self.font_class, self.c, self.fontsize, self.dpi)
1274
1275
1276class List(Box):

Callers 1

accentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…