(self, text, size, weight, track=TRACK)
| 118 | return self._by_weight[weight] |
| 119 | |
| 120 | def measure(self, text, size, weight, track=TRACK): |
| 121 | ft, cmap, _, hmtx = self._font(weight) |
| 122 | scale = size / ft["head"].unitsPerEm |
| 123 | w = sum(hmtx[cmap[ord(ch)]][0] * scale + track for ch in text) |
| 124 | return w - track |
| 125 | |
| 126 | def cap_height(self, size, weight): |
| 127 | ft, _, _, _ = self._font(weight) |