(self, c: str, width: float, state: ParserState,
char_class: type[Char] = Char)
| 1687 | """ |
| 1688 | |
| 1689 | def __init__(self, c: str, width: float, state: ParserState, |
| 1690 | char_class: type[Char] = Char): |
| 1691 | alternatives = state.fontset.get_sized_alternatives_for_symbol(state.font, c) |
| 1692 | |
| 1693 | state = state.copy() |
| 1694 | for fontname, sym in alternatives: |
| 1695 | state.font = fontname |
| 1696 | char = char_class(sym, state) |
| 1697 | if char.width >= width: |
| 1698 | break |
| 1699 | |
| 1700 | factor = width / char.width |
| 1701 | state.fontsize *= factor |
| 1702 | char = char_class(sym, state) |
| 1703 | |
| 1704 | super().__init__([char]) |
| 1705 | self.width = char.width |
| 1706 | |
| 1707 | |
| 1708 | def ship(box: Box, xy: tuple[float, float] = (0, 0)) -> Output: |
nothing calls this directly
no test coverage detected