MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / Accent

Class Accent

site-packages/matplotlib/mathtext.py:1503–1530  ·  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

1501 self.depth *= GROW_FACTOR
1502
1503class Accent(Char):
1504 """
1505 The font metrics need to be dealt with differently for accents,
1506 since they are already offset correctly from the baseline in
1507 TrueType fonts.
1508 """
1509 def _update_metrics(self):
1510 metrics = self._metrics = self.font_output.get_metrics(
1511 self.font, self.font_class, self.c, self.fontsize, self.dpi)
1512 self.width = metrics.xmax - metrics.xmin
1513 self.height = metrics.ymax - metrics.ymin
1514 self.depth = 0
1515
1516 def shrink(self):
1517 Char.shrink(self)
1518 self._update_metrics()
1519
1520 def grow(self):
1521 Char.grow(self)
1522 self._update_metrics()
1523
1524 def render(self, x, y):
1525 """
1526 Render the character to the canvas.
1527 """
1528 self.font_output.render_glyph(
1529 x - self._metrics.xmin, y + self._metrics.ymin,
1530 self.font, self.font_class, self.c, self.fontsize, self.dpi)
1531
1532class List(Box):
1533 """

Callers 2

c_over_cMethod · 0.85
accentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected