Revision: 6212 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6212&view=rev Author: mdboom Date: 2008年10月15日 18:35:57 +0000 (2008年10月15日) Log Message: ----------- Fix over-zealous caching in mathtext that causes one plot's font settings to affect the next. (This resulted in bold tick labels in log_demo.py when building the docs). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008年10月15日 17:54:38 UTC (rev 6211) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008年10月15日 18:35:57 UTC (rev 6212) @@ -565,8 +565,6 @@ A generic base class for all font setups that use Truetype fonts (through ft2font) """ - _fonts = {} - class CachedFont: def __init__(self, font): self.font = font @@ -579,14 +577,13 @@ def __init__(self, default_font_prop, mathtext_backend): Fonts.__init__(self, default_font_prop, mathtext_backend) - self.glyphd = {} + self.glyphd = {} + self._fonts = {} - if self._fonts == {}: - filename = findfont(default_font_prop) - default_font = self.CachedFont(FT2Font(str(filename))) + 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 Fonts.destroy(self) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6489 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6489&view=rev Author: mdboom Date: 2008年12月04日 19:01:44 +0000 (2008年12月04日) Log Message: ----------- Fix autosized angle brackets in mathtext. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008年12月04日 18:49:16 UTC (rev 6488) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008年12月04日 19:01:44 UTC (rev 6489) @@ -737,7 +737,9 @@ r'\widehat' : [('rm', '\x5e'), ('ex', '\x62'), ('ex', '\x63'), ('ex', '\x64')], r'\widetilde': [('rm', '\x7e'), ('ex', '\x65'), ('ex', '\x66'), - ('ex', '\x67')] + ('ex', '\x67')], + r'<' : [('cal', 'h'), ('ex', 'D')], + r'>' : [('cal', 'i'), ('ex', 'E')] } for alias, target in [('\leftparen', '('), @@ -843,8 +845,7 @@ if fontname == 'it' and isinstance(self, StixFonts): return self._get_glyph('rm', font_class, sym, fontsize) warn("Font '%s' does not have a glyph for '%s'" % - (cached_font.font.postscript_name, - sym.encode('ascii', 'backslashreplace')), + (fontname, sym.encode('ascii', 'backslashreplace')), MathTextWarning) warn("Substituting with a dummy symbol.", MathTextWarning) fontname = 'rm' @@ -956,6 +957,12 @@ except ValueError: return [(fontname, sym)] + fix_ups = { + ord('<'): 0x27e8, + ord('>'): 0x27e9 } + + uniindex = fix_ups.get(uniindex, uniindex) + for i in range(6): cached_font = self._get_font(i) glyphindex = cached_font.charmap.get(uniindex) @@ -2068,9 +2075,9 @@ | \| / \backslash \uparrow \downarrow \updownarrow \Uparrow \Downarrow \Updownarrow .""".split()) - _leftDelim = set(r"( [ { \lfloor \langle \lceil".split()) + _leftDelim = set(r"( [ { < \lfloor \langle \lceil".split()) - _rightDelim = set(r") ] } \rfloor \rangle \rceil".split()) + _rightDelim = set(r") ] } > \rfloor \rangle \rceil".split()) def __init__(self): # All forward declarations are here This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6492 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6492&view=rev Author: mdboom Date: 2008年12月04日 21:02:36 +0000 (2008年12月04日) Log Message: ----------- Trivial change Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008年12月04日 20:05:40 UTC (rev 6491) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008年12月04日 21:02:36 UTC (rev 6492) @@ -2735,7 +2735,7 @@ hlist = Hlist(parts) return hlist -#### +### ############################################################################## # MAIN This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6749 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6749&view=rev Author: mdboom Date: 2009年01月06日 19:36:29 +0000 (2009年1月06日) Log Message: ----------- Fix stix_font_demo.py Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2009年01月06日 19:34:52 UTC (rev 6748) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2009年01月06日 19:36:29 UTC (rev 6749) @@ -2296,7 +2296,7 @@ def _get_font(self): return self._font def _set_font(self, name): - if name in Parser._fontnames: + if name in ('rm', 'it', 'bf'): self.font_class = name self._font = name font = property(_get_font, _set_font) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6954 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6954&view=rev Author: mdboom Date: 2009年03月04日 18:16:50 +0000 (2009年3月04日) Log Message: ----------- Fix a few bugs when mathtext.default is 'regular' Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2009年03月04日 13:27:00 UTC (rev 6953) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2009年03月04日 18:16:50 UTC (rev 6954) @@ -843,7 +843,7 @@ return self.cm_fallback._get_glyph( fontname, 'it', sym, fontsize) else: - if fontname == 'it' and isinstance(self, StixFonts): + if fontname in ('it', 'regular') and isinstance(self, StixFonts): return self._get_glyph('rm', font_class, sym, fontsize) warn("Font '%s' does not have a glyph for '%s'" % (fontname, sym.encode('ascii', 'backslashreplace')), @@ -916,7 +916,7 @@ if mapping is not None: if isinstance(mapping, dict): - mapping = mapping[font_class] + mapping = mapping.get(font_class, 'rm') # Binary search for the source glyph lo = 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 6998 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6998&view=rev Author: mdboom Date: 2009年03月19日 14:44:01 +0000 (2009年3月19日) Log Message: ----------- Fix mapping regular font the StixSans when fontset is stixsans. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2009年03月19日 13:15:00 UTC (rev 6997) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2009年03月19日 14:44:01 UTC (rev 6998) @@ -908,7 +908,8 @@ # Handle these "fonts" that are actually embedded in # other fonts. mapping = stix_virtual_fonts.get(fontname) - if self._sans and mapping is None: + if (self._sans and mapping is None and + fontname not in ('regular', 'default')): mapping = stix_virtual_fonts['sf'] doing_sans_conversion = True else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7157 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7157&view=rev Author: mdboom Date: 2009年05月28日 16:49:17 +0000 (2009年5月28日) Log Message: ----------- Handle overrightarrow and overleftarrow in mathtext like accents. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2009年05月28日 16:30:12 UTC (rev 7156) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2009年05月28日 16:49:17 UTC (rev 7157) @@ -2445,7 +2445,9 @@ r"'" : r'\combiningacuteaccent', r'~' : r'\combiningtilde', r'.' : r'\combiningdotabove', - r'^' : r'\circumflexaccent' + r'^' : r'\circumflexaccent', + r'overrightarrow' : r'\rightarrow', + r'overleftarrow' : r'\leftarrow' } _wide_accents = set(r"widehat widetilde".split()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8807 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8807&view=rev Author: mdboom Date: 2010年11月22日 14:01:21 +0000 (2010年11月22日) Log Message: ----------- Don't add horizontal padding for overline -- submitted by Marshall Ward Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2010年11月18日 13:29:00 UTC (rev 8806) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2010年11月22日 14:01:21 UTC (rev 8807) @@ -2863,13 +2863,11 @@ height = body.height - body.shift_amount + thickness * 3.0 depth = body.depth + body.shift_amount - # Put a little extra space to the left and right of the body - padded_body = Hlist([Hbox(thickness * 2.0), - body, - Hbox(thickness * 2.0)]) + # Place overline above body rightside = Vlist([Hrule(state), Fill(), - padded_body]) + Hlist([body])]) + # Stretch the glue between the hrule and the body rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0), depth, 'exactly') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.