SF.net SVN: matplotlib: [3901] trunk/matplotlib/lib/matplotlib

2007-09-30 Thread jouni
Revision: 3901
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3901&view=rev
Author:   jouni
Date: 2007-09-30 13:08:50 -0700 (Sun, 30 Sep 2007)

Log Message:
---
use_tex in pdf backend: don't use AFM files, 
which are not there in some TeX distros

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
trunk/matplotlib/lib/matplotlib/dviread.py

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py
===
--- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-28 
15:57:49 UTC (rev 3900)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-30 
20:08:50 UTC (rev 3901)
@@ -500,70 +500,15 @@
 finally:
 fh.close()
 
-fh = open(fontinfo.afmfile, 'rb')
-matplotlib.verbose.report(
-'Reading metrics from ' + fontinfo.afmfile, 'debug')
-try:
-afmdata = AFM(fh)
-finally:
-fh.close()
-
 font = FT2Font(filename)
-font.attach_file(fontinfo.afmfile)
 
 widthsObject, fontdescObject, fontdictObject, fontfileObject = \
 [ self.reserveObject(n) for n in
 ('font widths', 'font descriptor',
  'font dictionary', 'font file') ]
 
-_, _, fullname, familyname, weight, italic_angle, fixed_pitch, \
-ul_position, ul_thickness = font.get_ps_font_info()
-
-if fontinfo.encodingfile is not None:
-enc = dviread.Encoding(fontinfo.encodingfile)
-widths = []
-for ch in enc:
-try:
-widths.append(afmdata.get_width_from_char_name(ch))
-except KeyError:
-matplotlib.verbose.report(
-'No width for %s in %s' % (ch, fullname), 
'debug-annoying')
-widths.append(0)
-
-differencesArray = [ Name(ch) for ch in enc ]
-differencesArray = [ 0 ] + differencesArray
-firstchar = 0
-lastchar = len(differencesArray) - 2
-else:
-widths = [ None for i in range(256) ]
-for ch in range(256):
-try:
-widths[ch] = afmdata.get_width_char(ch, isord=True)
-except KeyError:
-pass
-not_None = [ch for ch in range(256) 
-if widths[ch] is not None]
-firstchar = not_None[0]
-lastchar = not_None[-1]
-widths = widths[firstchar:lastchar+1]
-for i,w in enumerate(widths):
-if w is None: widths[i] = 0
-
-differencesArray = [ ]
-need_idx = True
-for ch in range(firstchar, lastchar+1):
-try:
-name = afmdata.get_name_char(ch, isord=True)
-if need_idx:
-differencesArray.append(ch)
-need_idx = False
-differencesArray.append(Name(name))
-except KeyError:
-matplotlib.verbose.report(
-'No name for glyph %d in %s' % (ch, fullname), 
-'debug-annoying')
-need_idx = True
-
+firstchar = 0
+lastchar = len(fontinfo.widths) - 1
 
 fontdict = {
 'Type':   Name('Font'),
@@ -575,15 +520,22 @@
 'FontDescriptor': fontdescObject,
 }
 
-fontdict.update({
-'Encoding': { 'Type': Name('Encoding'),
-  'Differences': differencesArray },
-})
+if fontinfo.encodingfile is not None:
+enc = dviread.Encoding(fontinfo.encodingfile)
+differencesArray = [ Name(ch) for ch in enc ]
+differencesArray = [ 0 ] + differencesArray
+fontdict.update({
+'Encoding': { 'Type': Name('Encoding'),
+  'Differences': differencesArray },
+})
 
+_, _, fullname, familyname, weight, italic_angle, fixed_pitch, \
+ul_position, ul_thickness = font.get_ps_font_info()
+
 flags = 0
 if fixed_pitch:   flags |= 1 << 0  # fixed width
 if 0: flags |= 1 << 1  # TODO: serif
-if 1: flags |= 1 << 2  # TODO: symbolic
+if 1: flags |= 1 << 2  # TODO: symbolic (most TeX fonts 
are)
 else: flags |= 1 << 5  # non-symbolic
 if italic_angle:  flags |= 1 << 6  # italic
 if 0: flags |= 1 << 16 # TODO: all caps
@@ -598,33 +550,17 @@
 'ItalicAngle': italic_angle,
 'Ascent':  font.ascender,
 'Descent': font.descender,
-'CapHeight':   1000, # default guess if missing from AFM file
-'X

SF.net SVN: matplotlib: [3902] trunk/matplotlib/lib/matplotlib/axes3d.py

2007-09-30 Thread efiring
Revision: 3902
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3902&view=rev
Author:   efiring
Date: 2007-09-30 13:32:31 -0700 (Sun, 30 Sep 2007)

Log Message:
---
bugfix by Zack, confirmed by Gary Ruben.

http://sourceforge.net/mailarchive/forum.php?thread_name=d8cf9020703071339y43354eaerbfa1a47d272e5d26%40mail.gmail.com&forum_name=matplotlib-users

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes3d.py

Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===
--- trunk/matplotlib/lib/matplotlib/axes3d.py   2007-09-30 20:08:50 UTC (rev 
3901)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py   2007-09-30 20:32:31 UTC (rev 
3902)
@@ -510,8 +510,8 @@
 #
 polys = []
 boxes = []
-for rs in npy.arange(0,rows,rstride):
-for cs in npy.arange(0,cols,cstride):
+for rs in npy.arange(0,rows-1,rstride):
+for cs in npy.arange(0,cols-1,cstride):
 ps = []
 corners = []
 for a,ta in [(X,tX),(Y,tY),(Z,tZ)]:


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins


SF.net SVN: matplotlib: [3903] trunk/matplotlib/lib/matplotlib/axes3d.py

2007-09-30 Thread efiring
Revision: 3903
  http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3903&view=rev
Author:   efiring
Date: 2007-09-30 13:47:55 -0700 (Sun, 30 Sep 2007)

Log Message:
---
Apply patch by Leon Barrett, tracker #1798196

Modified Paths:
--
trunk/matplotlib/lib/matplotlib/axes3d.py

Modified: trunk/matplotlib/lib/matplotlib/axes3d.py
===
--- trunk/matplotlib/lib/matplotlib/axes3d.py   2007-09-30 20:32:31 UTC (rev 
3902)
+++ trunk/matplotlib/lib/matplotlib/axes3d.py   2007-09-30 20:47:55 UTC (rev 
3903)
@@ -515,11 +515,11 @@
 ps = []
 corners = []
 for a,ta in [(X,tX),(Y,tY),(Z,tZ)]:
-ztop = a[rs][cs:min(cols-1,cs+cstride)]
+ztop = a[rs][cs:min(cols,cs+cstride+1)]
 zleft = 
ta[min(cols-1,cs+cstride)][rs:min(rows,rs+rstride+1)]
 zbase = 
a[min(rows-1,rs+rstride)][cs:min(cols,cs+cstride+1):]
 zbase = zbase[::-1]
-zright = ta[cs][rs:min(rows-1,rs+rstride):]
+zright = ta[cs][rs:min(rows,rs+rstride+1):]
 zright = zright[::-1]
 corners.append([ztop[0],ztop[-1],zbase[0],zbase[-1]])
 z = npy.concatenate((ztop,zleft,zbase,zright))


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins