10000 fix cmr10 negative sign in cmsy10 · matplotlib/matplotlib@71ea0cd · GitHub
[go: up one dir, main page]

Skip to content

Commit 71ea0cd

Browse files
committed
fix cmr10 negative sign in cmsy10
- fixes #17007 - see #17007 (comment)
1 parent 766db51 commit 71ea0cd

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
@@ -519,6 +519,11 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
519519
found_symbol = False
520520
font = self._get_font(new_fontname)
521521
if font is not None:
522+
if font.family_name == "cmr10" and uniindex == 0x2212:
523+
# minus sign exists in cmsy10 (not cmr10)
524+
font = get_font(
525+
cbook._get_data_path("fonts/ttf/cmsy10.ttf"))
526+
uniindex = 0xa1
522527
glyphindex = font.get_char_index(uniindex)
523528
if glyphindex != 0:
524529
found_symbol = True

0 commit comments

Comments
 (0)
0