Skip to content

Commit 2b050ec

Browse files
committed
add sub/superscript parameters for Arev Sans
1 parent 84ace61 commit 2b050ec

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

lib/matplotlib/mathtext.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,34 +1189,41 @@ def get_underline_thickness(self, font, fontsize, dpi):
11891189
# Percentage of x-height of additional horiz. space after sub/superscripts
11901190
SCRIPT_SPACE = {'cm': 0.05,
11911191
'stix': 0.10,
1192-
'stixsans': 0.10}
1192+
'stixsans': 0.10,
1193+
'arevsans': 0.10}
11931194
## Percentage of x-height that sub/superscripts drop below the baseline
11941195
SUBDROP = {'cm': 0.3,
11951196
'stix': 0.4,
1196-
'stixsans': 0.4}
1197+
'stixsans': 0.4,
1198+
'arevsans': 0.3}
11971199
# Percentage of x-height that superscripts are raised from the baseline
11981200
SUP1 = {'cm': 0.45,
11991201
'stix': 0.8,
1200-
'stixsans': 0.8}
1202+
'stixsans': 0.8,
1203+
'arevsans': 0.7}
12011204
# Percentage of x-height that subscripts drop below the baseline
12021205
SUB1 = {'cm': 0.4,
12031206
'stix': 0.6,
1204-
'stixsans': 0.6}
1207+
'stixsans': 0.6,
1208+
'arevsans': 0.6}
12051209
# Percentage of x-height that subscripts drop below the baseline when a
12061210
# superscript is present
12071211
SUB2 = {'cm': 0.3,
12081212
'stix': 0.6,
1209-
'stixsans': 0.5}
1213+
'stixsans': 0.5,
1214+
'arevsans': 0.8}
12101215
# Percentage of x-height that supercripts are offset relative to the subscript
12111216
# for slanted nuclei
12121217
DELTA = {'cm': 0.10,
12131218
'stix': 0.15,
1214-
'stixsans': 0.25}
1219+
'stixsans': 0.25,
1220+
'arevsans': 0.12}
12151221
# Percentage of x-height that supercripts are offset relative to the subscript
12161222
# for integrals
12171223
DELTAINTEGRAL = {'cm': 0.5,
12181224
'stix': 0.5,
1219-
'stixsans': 0.4}
1225+
'stixsans': 0.4,
1226+
'arevsans': 0.5}
12201227

12211228
class MathTextWarning(Warning):
12221229
pass
@@ -2717,9 +2724,15 @@ def subsuper(self, s, loc, toks):
27172724
state.font, state.fontsize, state.dpi)
27182725

27192726
fs = rcParams['mathtext.fontset']
2720-
# If a custom fontset is used, use CM parameters
2727+
# If a custom fontset is used, check if it is Arev Sans, otherwise use
2728+
# CM parameters.
27212729
if fs == 'custom':
2722-
fs = 'cm'
2730+
if (rcParams['mathtext.rm'] == 'sans' and
2731+
rcParams['font.sans-serif'][0].lower() == 'Arev Sans'.lower()):
2732+
fs = 'arevsans'
2733+
else:
2734+
fs = 'cm'
2735+
27232736

27242737
if napostrophes:
27252738
if super is None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy