The font metrics need to be dealt with differently for accents, since they are already offset correctly from the baseline in TrueType fonts.
| 1251 | |
| 1252 | |
| 1253 | class 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 | |
| 1276 | class List(Box): |
no outgoing calls
no test coverage detected
searching dependent graphs…