(self)
| 130 | self.rects: list[tuple[float, float, float, float]] = [] # (x, y, w, h) |
| 131 | |
| 132 | def to_vector(self) -> VectorParse: |
| 133 | w, h, d = map( |
| 134 | np.ceil, [self.box.width, self.box.height, self.box.depth]) |
| 135 | gs = [(info.font, info.fontsize, info.num, info.glyph_index, |
| 136 | ox, h - oy + info.offset) |
| 137 | for ox, oy, info in self.glyphs] |
| 138 | rs = [(bx, h - (by + bh), bw, bh) |
| 139 | for bx, by, bw, bh in self.rects] |
| 140 | # Output.rects has downwards ys, VectorParse.rects has upwards ys. |
| 141 | return VectorParse(w, h + d, d, gs, rs) |
| 142 | |
| 143 | def to_raster(self, *, antialiased: bool) -> RasterParse: |
| 144 | # Metrics y's and mathtext y's are oriented in opposite directions, |
no test coverage detected