Skip to content

Commit 9455799

Browse files
committed
revise comments
1 parent 0754fba commit 9455799

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ class UnicodeMathFonts(TruetypeFonts):
797797
"""
798798

799799
def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
800-
TruetypeFonts.__init__(self, default_font_prop, load_glyph_flags)
800+
super().__init__(default_font_prop, load_glyph_flags)
801801
prop = mpl.rcParams['mathtext.mathfont'] # type: ignore[index]
802802
font = findfont(prop)
803803
self.fontmap['mathfont'] = font
@@ -851,17 +851,16 @@ def _is_greek_uppercase(codepoint: CharacterCodeType) -> bool:
851851
def _is_greek_lowercase(codepoint: CharacterCodeType) -> bool:
852852
return codepoint in greek_lowercase_domain
853853

854-
# check if character is digit, latin letter, or greek letter
854+
# digits, latin letters, and greek letter are mapped by separate rules
855855
if _is_digit(uniindex):
856-
# handle digits
857856
_alphabet_map = {
858857
'normal': 'up',
859858
'rm': 'up',
860-
'it': 'it',
859+
'it': 'up', # italic digits are not available
861860
'tt': 'tt',
862861
'sf': 'sfup',
863862
'bf': 'bfup',
864-
'bfit': 'bfup',
863+
'bfit': 'bfup', # bold italic digits are not available
865864
'bb': 'bb',
866865
}
867866
alphabet = _alphabet_map.get(fontname, 'up')
@@ -901,7 +900,7 @@ def _is_greek_lowercase(codepoint: CharacterCodeType) -> bool:
901900
else:
902901
alphabet = 'up'
903902

904-
if (alphabet != 'up'):
903+
if alphabet != 'up':
905904
alphabet_lut = unicode_math_lut.get(alphabet, {})
906905
new_uniindex = alphabet_lut.get(uniindex, uniindex)
907906
else:

0 commit comments

Comments
 (0)