MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / _font

Method _font

assets/generate-language-tiles.py:113–118  ·  view source on GitHub ↗
(self, weight)

Source from the content-addressed store, hash-verified

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)

Callers 3

measureMethod · 0.95
cap_heightMethod · 0.95
outlineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected