Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8a31a0

Browse files
committed
fix cmr10 negative sign in cmsy10
- fixes #17007 - see #17007 (comment)
1 parent 1ed5c91 commit f8a31a0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,11 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
522522
found_symbol = False
523523
font = self._get_font(new_fontname)
524524
if font is not None:
525+
if font.family_name == "cmr10" and uniindex == 0x2212:
526+
# minus sign exists in cmsy10 (not cmr10)
527+
font = get_font(
528+
cbook._get_data_path("fonts/ttf/cmsy10.ttf"))
529+
uniindex = 0xa1
525530
glyphindex = font.get_char_index(uniindex)
526531
if glyphindex != 0:
527532
found_symbol = True

0 commit comments

Comments
 (0)