Skip to content

Commit b62d117

Browse files
committed
clean up, remove unnecesary do_kern=False
1 parent 2959e57 commit b62d117

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/matplotlib/mathtext.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,19 +2734,17 @@ def subsuper(self, s, loc, toks):
27342734
new_children = new_children[:-1]
27352735
last_char = new_children[-1]
27362736
last_char.width = last_char._metrics.advance
2737+
# create new Hlist without kerning
27372738
nucleus = Hlist(new_children, do_kern=False)
27382739
else:
27392740
last_char.width = last_char._metrics.advance
2740-
nucleus = Hlist([nucleus],do_kern=False)
2741-
2741+
nucleus = Hlist([nucleus])
27422742

27432743
state = self.get_state()
27442744
rule_thickness = state.font_output.get_underline_thickness(
27452745
state.font, state.fontsize, state.dpi)
27462746
xHeight = state.font_output.get_xheight(
27472747
state.font, state.fontsize, state.dpi)
2748-
print(last_char, last_char.height,
2749-
xHeight)
27502748

27512749
fs = rcParams['mathtext.fontset']
27522750
# If a custom fontset is used, check if it is Arev Sans, otherwise use
@@ -2758,7 +2756,6 @@ def subsuper(self, s, loc, toks):
27582756
else:
27592757
fs = 'cm'
27602758

2761-
27622759
if napostrophes:
27632760
if super is None:
27642761
super = Hlist([])
@@ -2849,7 +2846,7 @@ def subsuper(self, s, loc, toks):
28492846

28502847
if not self.is_dropsub(last_char):
28512848
x.width += SCRIPT_SPACE[fs] * xHeight
2852-
result = Hlist([nucleus, x], do_kern=False)
2849+
result = Hlist([nucleus, x])
28532850
return [result]
28542851

28552852
def _genfrac(self, ldelim, rdelim, rule, style, num, den):

lib/matplotlib/tests/test_mathtext.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@
9898
r'$M \, M \thinspace M \/ M \> M \: M \; M \ M \enspace M \quad M \qquad M \! M$',
9999
r'$\Cup$ $\Cap$ $\leftharpoonup$ $\barwedge$ $\rightharpoonup$',
100100
r'$\dotplus$ $\doteq$ $\doteqdot$ $\ddots$',
101-
r'$x_kx^py^{p-2} d_i^jb_jc_kd x^j_i E^0 E^0_u$', # github issue #4873
102-
r'${x}_{k}{x}^{p}{y}^{p-2} {d}_{i}^{j}{b}_{j}{c}_{k}{d} {x}^{j}_{i}{E}^{0}{E}^0_u$',
101+
r'$xyz^kx_kx^py^{p-2} d_i^jb_jc_kd x^j_i E^0 E^0_u$', # github issue #4873
102+
r'${xyz}^k{x}_{k}{x}^{p}{y}^{p-2} {d}_{i}^{j}{b}_{j}{c}_{k}{d} {x}^{j}_{i}{E}^{0}{E}^0_u$',
103103
r'${\int}_x^x x\oint_x^x x\int_{X}^{X}x\int_x x \int^x x \int_{x} x\int^{x}{\int}_{x} x{\int}^{x}_{x}x$',
104+
r'$f^\prime f^2 f^a F^2',
104105

105106
]
106107

0 commit comments

Comments
 (0)