MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / to_vector

Method to_vector

lib/matplotlib/_mathtext.py:132–141  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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,

Callers 1

_parse_cachedMethod · 0.80

Calls 1

VectorParseClass · 0.85

Tested by

no test coverage detected