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

Skip to content

Commit 50573a8

Browse files
committed
Fix STIX fonts.
svn path=/trunk/matplotlib/; revision=5356
1 parent 0409b9f commit 50573a8

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

lib/matplotlib/font_manager.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ def set_style(self, style):
755755
if style not in ('normal', 'italic', 'oblique', None):
756756
raise ValueError("style must be normal, italic or oblique")
757757
self._slant = style
758+
set_slant = set_style
758759

759760
def set_variant(self, variant):
760761
"""Set the font variant. Values are: normal or small-caps."""
@@ -807,7 +808,10 @@ def set_file(self, file):
807808

808809
def set_fontconfig_pattern(self, pattern):
809810
for key, val in self._parse_fontconfig_pattern(pattern).items():
810-
getattr(self, "set_" + key)(val)
811+
if type(val) == list:
812+
getattr(self, "set_" + key)(val[0])
813+
else:
814+
getattr(self, "set_" + key)(val)
811815

812816
def copy(self):
813817
"""Return a deep copy of self"""
@@ -951,7 +955,7 @@ def findfont(self, prop, fontext='ttf'):
951955
fname = prop.get_file()
952956
if fname is not None:
953957
verbose.report('findfont returning %s'%fname, 'debug')
954-
return fname
958+
return fname[0]
955959

956960
if fontext == 'afm':
957961
fontdict = self.afmdict

lib/matplotlib/mathtext.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -890,18 +890,18 @@ class StixFonts(UnicodeFonts):
890890
A font handling class for the STIX fonts
891891
"""
892892
_fontmap = { 'rm' : 'STIXGeneral',
893-
'it' : 'STIXGeneralItalic',
894-
'bf' : 'STIXGeneralBol',
895-
'nonunirm' : 'STIXNonUni',
896-
'nonuniit' : 'STIXNonUniIta',
897-
'nonunibf' : 'STIXNonUniBol',
893+
'it' : 'STIXGeneral:italic',
894+
'bf' : 'STIXGeneral:weight=bold',
895+
'nonunirm' : 'STIXNonUnicode',
896+
'nonuniit' : 'STIXNonUnicode:italic',
897+
'nonunibf' : 'STIXNonUnicode:weight=bold',
898898

899899
0 : 'STIXGeneral',
900-
1 : 'STIXSiz1Sym',
901-
2 : 'STIXSiz2Sym',
902-
3 : 'STIXSiz3Sym',
903-
4 : 'STIXSiz4Sym',
904-
5 : 'STIXSiz5Sym'
900+
1 : 'STIXSize1',
901+
2 : 'STIXSize2',
902+
3 : 'STIXSize3',
903+
4 : 'STIXSize4',
904+
5 : 'STIXSize5'
905905
}
906906
fontmap = {}
907907
use_cmex = False

0 commit comments

Comments
 (0)