10000 mathtext: Use DejaVu display symbols when available by zblz · Pull Request #5612 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

mathtext: Use DejaVu display symbols when available #5612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/matplotlib/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,15 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
return self.bakoma._get_glyph(fontname,
font_class, sym, fontsize)
else:
# check whether the glyph is available in the display font
uniindex = get_unicode_index(sym)
font = self._get_font('ex')
if font is not None:
glyphindex = font.get_char_index(uniindex)
if glyphindex != 0:
return super(DejaVuFonts, self)._get_glyph('ex',
font_class, sym, fontsize)
# otherwise return regular glyph
return super(DejaVuFonts, self)._get_glyph(fontname,
font_class, sym, fontsize)

Expand All @@ -921,6 +930,7 @@ class DejaVuSerifFonts(DejaVuFonts):
'bf' : 'DejaVu Serif:weight=bold',
'sf' : 'DejaVu Sans',
'tt' : 'DejaVu Sans Mono',
'ex' : 'DejaVu Serif Display',
}

class DejaVuSansFonts(DejaVuFonts):
Expand All @@ -934,6 +944,7 @@ class DejaVuSansFonts(DejaVuFonts):
'bf' : 'DejaVu Sans:weight=bold',
'sf' : 'DejaVu Sans',
'tt' : 'DejaVu Sans Mono',
'ex' : 'DejaVu Sans Display',
}

class StixFonts(UnicodeFonts):
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
0