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

Skip to content

Commit 4554032

Browse files
committed
Final fix to get STIX fonts working on Unicode-narrow platforms.
svn path=/trunk/matplotlib/; revision=5571
1 parent 9a9d70e commit 4554032

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/matplotlib/mathtext.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,11 @@ def _get_glyph(self, fontname, font_class, sym, fontsize):
842842
new_fontname = fontname
843843

844844
if fontname == 'it':
845-
unistring = unichr(uniindex)
846-
if (not unicodedata.category(unistring)[0] == "L"
847-
or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
848-
new_fontname = 'rm'
845+
if uniindex < 0x10000:
846+
unistring = unichr(uniindex)
847+
if (not unicodedata.category(unistring)[0] == "L"
848+
or unicodedata.name(unistring).startswith("GREEK CAPITAL")):
849+
new_fontname = 'rm'
849850

850851
slanted = (new_fontname == 'it') or sym in self._slanted_symbols
851852
found_symbol = False

0 commit comments

Comments
 (0)