(self, percentage: float)
| 2354 | return [hlist] |
| 2355 | |
| 2356 | def _make_space(self, percentage: float) -> Kern: |
| 2357 | # In TeX, an em (the unit usually used to measure horizontal lengths) |
| 2358 | # is not the width of the character 'm'; it is the same in different |
| 2359 | # font styles (e.g. roman or italic). Mathtext, however, uses 'm' in |
| 2360 | # the normal style so that horizontal spaces don't depend on the |
| 2361 | # current font style. |
| 2362 | # TODO: this should be read from the font file |
| 2363 | state = self.get_state() |
| 2364 | key = (state.font, state.fontsize, state.dpi) |
| 2365 | width = self._em_width_cache.get(key) |
| 2366 | if width is None: |
| 2367 | width = state.fontset.get_quad('normal', state.fontsize, state.dpi) |
| 2368 | self._em_width_cache[key] = width |
| 2369 | return Kern(width * percentage) |
| 2370 | |
| 2371 | _space_widths = { |
| 2372 | r'\,': 0.16667, # 3/18 em = 3 mu |
no test coverage detected