|
From: <md...@us...> - 2008-12-04 19:01:48
|
Revision: 6489
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6489&view=rev
Author: mdboom
Date: 2008-12-04 19:01:44 +0000 (Thu, 04 Dec 2008)
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.
|