From: <md...@us...> - 2007-11-26 14:10:14
|
Revision: 4437 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4437&view=rev Author: mdboom Date: 2007-11-26 06:10:11 -0800 (Mon, 26 Nov 2007) Log Message: ----------- Merged revisions 4406-4436 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4407 | mdboom | 2007-11-21 11:35:38 -0500 (Wed, 21 Nov 2007) | 2 lines Mathtext speed improvement. ........ r4434 | jdh2358 | 2007-11-25 23:06:01 -0500 (Sun, 25 Nov 2007) | 1 line added x11 to default darwin list ........ r4435 | mdboom | 2007-11-26 09:06:57 -0500 (Mon, 26 Nov 2007) | 2 lines Fix stixsans mode: Upper case Greek should be non-slanted. ........ r4436 | mdboom | 2007-11-26 09:08:30 -0500 (Mon, 26 Nov 2007) | 2 lines Fix stixsans mode: Circled numerals should never be slanted. ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/_mathtext_data.py branches/transforms/lib/matplotlib/mathtext.py branches/transforms/setupext.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4405 + /trunk/matplotlib:1-4436 Modified: branches/transforms/lib/matplotlib/_mathtext_data.py =================================================================== --- branches/transforms/lib/matplotlib/_mathtext_data.py 2007-11-26 14:08:30 UTC (rev 4436) +++ branches/transforms/lib/matplotlib/_mathtext_data.py 2007-11-26 14:10:11 UTC (rev 4437) @@ -2296,7 +2296,7 @@ [ (0x0041, 0x0041, 'it', 0xe154), # A-B (0x0043, 0x0043, 'it', 0x2102), # C (missing in beta STIX fonts) - (0x0044, 0x0044, 'it', 0x2145), # D + (0x0044, 0x0044, 'it', 0x2145), # D (0x0045, 0x0047, 'it', 0xe156), # E-G (0x0048, 0x0048, 'it', 0x210d), # H (missing in beta STIX fonts) (0x0049, 0x004d, 'it', 0xe159), # I-M @@ -2344,8 +2344,8 @@ ], 'it': [ - (0x0030, 0x0030, 'it', 0x24ea), # 0 - (0x0031, 0x0039, 'it', 0x2460), # 1-9 + (0x0030, 0x0030, 'rm', 0x24ea), # 0 + (0x0031, 0x0039, 'rm', 0x2460), # 1-9 (0x0041, 0x005a, 'it', 0x24b6), # A-Z (0x0061, 0x007a, 'it', 0x24d0) # a-z ], @@ -2434,10 +2434,10 @@ [ # These numerals are actually upright. We don't actually # want italic numerals ever. - (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 + (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9 (0x0041, 0x005a, 'it', 0x1d608), # A-Z (0x0061, 0x007a, 'it', 0x1d622), # a-z - (0x0391, 0x03a9, 'it', 0xe1bf), # \Alpha-\Omega + (0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega (0x03b1, 0x03c9, 'it', 0xe1d8), # \alpha-\omega (0x03d1, 0x03d1, 'it', 0xe1f2), # theta variant (0x03d5, 0x03d5, 'it', 0xe1f3), # phi variant Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-11-26 14:08:30 UTC (rev 4436) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-11-26 14:10:11 UTC (rev 4437) @@ -503,6 +503,7 @@ (through ft2font) """ basepath = os.path.join( get_data_path(), 'fonts' ) + _fonts = {} class CachedFont: def __init__(self, font): @@ -517,21 +518,17 @@ def __init__(self, default_font_prop, mathtext_backend): Fonts.__init__(self, default_font_prop, mathtext_backend) self.glyphd = {} - self.fonts = {} - filename = findfont(default_font_prop) - default_font = self.CachedFont(FT2Font(str(filename))) + if self._fonts == {}: + filename = findfont(default_font_prop) + default_font = self.CachedFont(FT2Font(str(filename))) - self.fonts['default'] = default_font + self._fonts['default'] = default_font def destroy(self): self.glyphd = None - for cached_font in self.fonts.values(): - cached_font.charmap = None - cached_font.glyphmap = None - cached_font.font = None Fonts.destroy(self) - + def _get_font(self, font): """Looks up a CachedFont with its charmap and inverse charmap. font may be a TeX font name (cal, rm, it etc.), or postscript name.""" @@ -540,16 +537,16 @@ else: basename = font - cached_font = self.fonts.get(basename) + cached_font = self._fonts.get(basename) if cached_font is None: try: font = FT2Font(basename) except RuntimeError: return None cached_font = self.CachedFont(font) - self.fonts[basename] = cached_font - self.fonts[font.postscript_name] = cached_font - self.fonts[font.postscript_name.lower()] = cached_font + self._fonts[basename] = cached_font + self._fonts[font.postscript_name] = cached_font + self._fonts[font.postscript_name.lower()] = cached_font return cached_font def _get_offset(self, cached_font, glyph, fontsize, dpi): Modified: branches/transforms/setupext.py =================================================================== --- branches/transforms/setupext.py 2007-11-26 14:08:30 UTC (rev 4436) +++ branches/transforms/setupext.py 2007-11-26 14:10:11 UTC (rev 4437) @@ -51,7 +51,7 @@ 'linux' : ['/usr/local', '/usr',], 'cygwin' : ['/usr/local', '/usr',], 'darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local', - '/usr', '/sw'], + '/usr', '/sw', '/usr/X11R6'], 'freebsd4' : ['/usr/local', '/usr'], 'freebsd5' : ['/usr/local', '/usr'], 'freebsd6' : ['/usr/local', '/usr'], This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |