MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / accent

Method accent

site-packages/matplotlib/mathtext.py:2742–2764  ·  view source on GitHub ↗
(self, s, loc, toks)

Source from the content-addressed store, hash-verified

2740 ) (set(_accent_map))
2741
2742 def accent(self, s, loc, toks):
2743 assert len(toks)==1
2744 state = self.get_state()
2745 thickness = state.font_output.get_underline_thickness(
2746 state.font, state.fontsize, state.dpi)
2747 if len(toks[0]) != 2:
2748 raise ParseFatalException("Error parsing accent")
2749 accent, sym = toks[0]
2750 if accent in self._wide_accents:
2751 accent_box = AutoWidthChar(
2752 '\\' + accent, sym.width, state, char_class=Accent)
2753 else:
2754 accent_box = Accent(self._accent_map[accent], state)
2755 if accent == 'mathring':
2756 accent_box.shrink()
2757 accent_box.shrink()
2758 centered = HCentered([Hbox(sym.width / 4.0), accent_box])
2759 centered.hpack(sym.width, 'exactly')
2760 return Vlist([
2761 centered,
2762 Vbox(0., thickness * 2.0),
2763 Hlist([sym])
2764 ])
2765
2766 def function(self, s, loc, toks):
2767 self.push_state()

Callers

nothing calls this directly

Calls 12

get_stateMethod · 0.95
shrinkMethod · 0.95
ParseFatalExceptionClass · 0.90
AutoWidthCharClass · 0.85
AccentClass · 0.85
HCenteredClass · 0.85
HboxClass · 0.85
VlistClass · 0.85
VboxClass · 0.85
HlistClass · 0.85
hpackMethod · 0.80

Tested by

no test coverage detected