MCPcopy Index your code
hub / github.com/python/cpython / metrics

Method metrics

Lib/tkinter/font.py:164–182  ·  view source on GitHub ↗

Return font metrics. For best performance, create a dummy widget using this font before calling this method.

(self, *options, **kw)

Source from the content-addressed store, hash-verified

162 return self._tk.getint(self._call("font", "measure", self.name, *args))
163
164 def metrics(self, *options, **kw):
165 """Return font metrics.
166
167 For best performance, create a dummy widget
168 using this font before calling this method."""
169 args = ()
170 displayof = kw.pop('displayof', None)
171 if displayof:
172 args = ('-displayof', displayof)
173 if options:
174 args = args + self._get(options)
175 return self._tk.getint(
176 self._call("font", "metrics", self.name, *args))
177 else:
178 res = self._split(self._call("font", "metrics", self.name, *args))
179 options = {}
180 for i in range(0, len(res), 2):
181 options[res[i][1:]] = self._tk.getint(res[i+1])
182 return options
183
184
185def families(root=None, displayof=None):

Callers 2

font.pyFile · 0.80
test_metricsMethod · 0.80

Calls 5

_getMethod · 0.95
_splitMethod · 0.80
popMethod · 0.45
getintMethod · 0.45
_callMethod · 0.45

Tested by 1

test_metricsMethod · 0.64