Return font metrics. For best performance, create a dummy widget using this font before calling this method.
(self, *options, **kw)
| 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 | |
| 185 | def families(root=None, displayof=None): |