A `Kern` node has a width field to specify a (normally negative) amount of spacing. This spacing correction appears in horizontal lists between letters like A and V when the font designer said that it looks better to move them closer together or further apart. A kern node can al
| 1613 | |
| 1614 | |
| 1615 | class Kern(Node): |
| 1616 | """ |
| 1617 | A `Kern` node has a width field to specify a (normally |
| 1618 | negative) amount of spacing. This spacing correction appears in |
| 1619 | horizontal lists between letters like A and V when the font |
| 1620 | designer said that it looks better to move them closer together or |
| 1621 | further apart. A kern node can also appear in a vertical list, |
| 1622 | when its *width* denotes additional spacing in the vertical |
| 1623 | direction. |
| 1624 | """ |
| 1625 | |
| 1626 | height = 0 |
| 1627 | depth = 0 |
| 1628 | |
| 1629 | def __init__(self, width: float): |
| 1630 | super().__init__() |
| 1631 | self.width = width |
| 1632 | |
| 1633 | def __repr__(self) -> str: |
| 1634 | return "k%.02f" % self.width |
| 1635 | |
| 1636 | def shrink(self) -> None: |
| 1637 | super().shrink() |
| 1638 | if self.size < NUM_SIZE_LEVELS: |
| 1639 | self.width *= SHRINK_FACTOR |
| 1640 | |
| 1641 | |
| 1642 | class AutoHeightChar(Hlist): |