(self, weight)
| 111 | self._by_weight = {} |
| 112 | |
| 113 | def _font(self, weight): |
| 114 | if weight not in self._by_weight: |
| 115 | ft = TTFont(FONT) |
| 116 | instantiateVariableFont(ft, {"wght": weight}, inplace=True) |
| 117 | self._by_weight[weight] = (ft, ft.getBestCmap(), ft.getGlyphSet(), ft["hmtx"]) |
| 118 | return self._by_weight[weight] |
| 119 | |
| 120 | def measure(self, text, size, weight, track=TRACK): |
| 121 | ft, cmap, _, hmtx = self._font(weight) |
no outgoing calls
no test coverage detected