You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <md...@us...> - 2008-05-14 13:02:39
|
Revision: 5136
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5136&view=rev
Author: mdboom
Date: 2008-05-14 05:59:46 -0700 (Wed, 14 May 2008)
Log Message:
-----------
Fix font embedding on Windows.
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/cbook.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-05-09 12:46:00 UTC (rev 5135)
+++ branches/v0_91_maint/CHANGELOG 2008-05-14 12:59:46 UTC (rev 5136)
@@ -1,3 +1,5 @@
+2008-05-14 Don't use stat on Windows (fixes font embedding problem) - MGD
+
2008-05-09 Fix /singlequote (') in Postscript backend - MGD
2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
Modified: branches/v0_91_maint/lib/matplotlib/cbook.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-09 12:46:00 UTC (rev 5135)
+++ branches/v0_91_maint/lib/matplotlib/cbook.py 2008-05-14 12:59:46 UTC (rev 5136)
@@ -412,8 +412,11 @@
result = self._cache.get(path)
if result is None:
realpath = os.path.realpath(path)
- stat = os.stat(realpath)
- stat_key = (stat.st_ino, stat.st_dev)
+ if sys.platform == 'win32':
+ stat_key = realpath
+ else:
+ stat = os.stat(realpath)
+ stat_key = (stat.st_ino, stat.st_dev)
result = realpath, stat_key
self._cache[path] = result
return result
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-09 12:46:51
|
Revision: 5135
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5135&view=rev
Author: mdboom
Date: 2008-05-09 05:46:00 -0700 (Fri, 09 May 2008)
Log Message:
-----------
Merged revisions 5129-5134 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5130 | mdboom | 2008-05-08 12:45:55 -0400 (Thu, 08 May 2008) | 2 lines
Fix kerning in SVG.
........
r5134 | mdboom | 2008-05-09 08:39:25 -0400 (Fri, 09 May 2008) | 2 lines
Fix /singlequote (') in Ps backend.
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5128
+ /branches/v0_91_maint:1-5134
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-09 12:39:25 UTC (rev 5134)
+++ trunk/matplotlib/CHANGELOG 2008-05-09 12:46:00 UTC (rev 5135)
@@ -1,3 +1,7 @@
+2008-05-09 Fix /singlequote (') in Postscript backend - MGD
+
+2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
+
2008-05-07 Switched to future numpy histogram semantic in hist - MM
2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-09 12:39:25 UTC (rev 5134)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-09 12:46:00 UTC (rev 5135)
@@ -95,6 +95,7 @@
s=s.replace("\\", "\\\\")
s=s.replace("(", "\\(")
s=s.replace(")", "\\)")
+ s=s.replace("'", "\\251")
s=re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s)
return s
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-09 12:39:41
|
Revision: 5134
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5134&view=rev
Author: mdboom
Date: 2008-05-09 05:39:25 -0700 (Fri, 09 May 2008)
Log Message:
-----------
Fix /singlequote (') in Ps backend.
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-05-09 07:45:29 UTC (rev 5133)
+++ branches/v0_91_maint/CHANGELOG 2008-05-09 12:39:25 UTC (rev 5134)
@@ -1,3 +1,5 @@
+2008-05-09 Fix /singlequote (') in Postscript backend - MGD
+
2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py 2008-05-09 07:45:29 UTC (rev 5133)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_ps.py 2008-05-09 12:39:25 UTC (rev 5134)
@@ -96,6 +96,7 @@
s=s.replace("\\", "\\\\")
s=s.replace("(", "\\(")
s=s.replace(")", "\\)")
+ s=s.replace("'", "\\251")
s=re.sub(r"[^ -~\n]", lambda x: r"\%03o"%ord(x.group()), s)
return s
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-05-09 07:45:43
|
Revision: 5133
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5133&view=rev
Author: efiring
Date: 2008-05-09 00:45:29 -0700 (Fri, 09 May 2008)
Log Message:
-----------
Fix bugs I introduced in last work on backend_ps.py.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backend_bases.py
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-08 17:24:15 UTC (rev 5132)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-09 07:45:29 UTC (rev 5133)
@@ -4552,7 +4552,7 @@
d2 = (x-ix2-0.5)**2 + 3.0 * (y-iy2-0.5)**2
bdist = (d1<d2)
- for i in xrange(len(x)):
+ for i in range(len(x)):
if bdist[i]:
lattice1[ix1[i], iy1[i]]+=1
else:
Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-05-08 17:24:15 UTC (rev 5132)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-05-09 07:45:29 UTC (rev 5133)
@@ -123,9 +123,10 @@
if showedges:
edgecolors = np.array([[0.0, 0.0, 0.0, 1.0]], np.float_)
+ linewidths = np.array([1.0], np.float_)
else:
edgecolors = facecolors
- linewidths = np.array([1.0], np.float_)
+ linewidths = np.array([0.0], np.float_)
return self.draw_path_collection(
master_transform, cliprect, clippath, clippath_trans,
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-08 17:24:15 UTC (rev 5132)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2008-05-09 07:45:29 UTC (rev 5133)
@@ -744,68 +744,6 @@
""" % locals()
self._pswriter.write(ps)
- def _draw_ps_oldstyle(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
- """
- Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
- applied. 'ps' must consist of PostScript commands to construct a path.
-
- This is the JDH-modified version of the original. It is kept
- here now to facilitate checking the version below until we converge.
-
- """
- # local variable eliminates all repeated attribute lookups
- write = self._pswriter.write
- if debugPS and command:
- write("% "+command+"\n")
-
- stroke = (stroke and gc.get_linewidth() > 0.0 and
- (len(gc.get_rgb()) <= 3 or gc.get_rgb()[3] != 0.0))
- fill = (fill and rgbFace is not None and
- (len(rgbFace) <= 3 or rgbFace[3] != 0.0))
-
- if stroke or gc.get_linewidth() > 0.0:
- self.set_linewidth(gc.get_linewidth())
- jint = gc.get_joinstyle()
- self.set_linejoin(jint)
- cint = gc.get_capstyle()
- self.set_linecap(cint)
- self.set_linedash(*gc.get_dashes())
- self.set_color(*gc.get_rgb()[:3])
-
- cliprect = gc.get_clip_rectangle()
- if cliprect:
- x,y,w,h=cliprect.bounds
- write('gsave\n%1.4g %1.4g %1.4g %1.4g clipbox\n' % (w,h,x,y))
- clippath, clippath_trans = gc.get_clip_path()
- if clippath:
- id = self._get_clip_path(clippath, clippath_trans)
- write('gsave\n%s\n' % id)
-
- # Jochen, is the strip necessary? - this could be a honking big string
- write(ps.strip())
- write("\n")
-
- hatch = gc.get_hatch()
- if hatch:
- self.set_hatch(hatch)
-
- if fill:
- #print 'rgbface', rgbFace
- write("gsave\n")
- self.set_color(store=0, *rgbFace[:3])
- write("fill\ngrestore\n")
-
- if stroke or gc.get_linewidth() > 0.0:
- write("stroke\n")
- else:
- write("newpath\n")
-
- if clippath:
- write("grestore\n")
- if cliprect:
- write("grestore\n")
-
-
def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
"""
Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
@@ -820,13 +758,13 @@
write = self._pswriter.write
if debugPS and command:
write("% "+command+"\n")
- write('gsave\n')
- stroke = (stroke and gc.get_linewidth() > 0.0 and
+ mightstroke = (gc.get_linewidth() > 0.0 and
(len(gc.get_rgb()) <= 3 or gc.get_rgb()[3] != 0.0))
+ stroke = stroke and mightstroke
fill = (fill and rgbFace is not None and
(len(rgbFace) <= 3 or rgbFace[3] != 0.0))
- if stroke:
+ if mightstroke:
self.set_linewidth(gc.get_linewidth())
jint = gc.get_joinstyle()
self.set_linejoin(jint)
@@ -834,6 +772,7 @@
self.set_linecap(cint)
self.set_linedash(*gc.get_dashes())
self.set_color(*gc.get_rgb()[:3])
+ write('gsave\n')
cliprect = gc.get_clip_rectangle()
if cliprect:
@@ -852,7 +791,6 @@
if hatch:
self.set_hatch(hatch)
-
if fill:
if stroke:
write("gsave\n")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-08 17:24:24
|
Revision: 5132
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5132&view=rev
Author: mdboom
Date: 2008-05-08 10:24:15 -0700 (Thu, 08 May 2008)
Log Message:
-----------
Don't rasterize quadmeshes by default -- rasterizing is still somewhat
experimental, so saving for after upcoming 0.98 beta release.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/collections.py
Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py 2008-05-08 16:49:50 UTC (rev 5131)
+++ trunk/matplotlib/lib/matplotlib/collections.py 2008-05-08 17:24:15 UTC (rev 5132)
@@ -484,13 +484,11 @@
offsets = transOffset.transform_non_affine(offsets)
transOffset = transOffset.get_affine()
- renderer.start_rasterizing()
renderer.draw_quad_mesh(
transform.frozen(), self.clipbox, clippath, clippath_trans,
self._meshWidth, self._meshHeight, self._coordinates,
offsets, transOffset, self._facecolors, self._antialiased,
self._showedges)
- renderer.stop_rasterizing()
renderer.close_group(self.__class__.__name__)
class PolyCollection(Collection):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-08 16:50:02
|
Revision: 5131
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5131&view=rev
Author: mdboom
Date: 2008-05-08 09:49:50 -0700 (Thu, 08 May 2008)
Log Message:
-----------
A number of SVG improvements: Clipping in markers, collections and
text. Text kerning with embedded fonts.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-05-08 16:45:55 UTC (rev 5130)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-05-08 16:49:50 UTC (rev 5131)
@@ -193,11 +193,20 @@
write('<defs><path id="%s" d="%s"/></defs>\n' % (name, key))
self._markers[key] = name
+ clipid = self._get_gc_clip_svg(gc)
+ if clipid is None:
+ clippath = ''
+ else:
+ clippath = 'clip-path="url(#%s)"' % clipid
+
+ write('<g %s>' % clippath)
trans_and_flip = self._make_flip_transform(trans)
tpath = trans_and_flip.transform_path(path)
for x, y in tpath.vertices:
details = 'xlink:href="#%s" x="%f" y="%f"' % (name, x, y)
- self._draw_svg_element('use', details, gc, rgbFace)
+ style = self._get_style(gc, rgbFace)
+ self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details))
+ write('</g>')
def draw_path_collection(self, master_transform, cliprect, clippath,
clippath_trans, paths, all_transforms, offsets,
@@ -221,8 +230,14 @@
path_codes, cliprect, clippath, clippath_trans,
offsets, offsetTrans, facecolors, edgecolors,
linewidths, linestyles, antialiaseds):
+ clipid = self._get_gc_clip_svg(gc)
+ if clipid is not None:
+ write('<g clip-path="url(#%s)">' % clipid)
details = 'xlink:href="#%s" x="%f" y="%f"' % (path_id, xo, self.height - yo)
- self._draw_svg_element('use', details, gc, rgbFace)
+ style = self._get_style(gc, rgbFace)
+ self._svgwriter.write ('<use style="%s" %s/>\n' % (style, details))
+ if clipid is not None:
+ write('</g>')
self._path_collection_id += 1
@@ -309,7 +324,12 @@
write(path)
write('</defs>\n')
- svg = ['<g style="fill: %s; opacity: %s" transform="' % (color, gc.get_alpha())]
+ svg = []
+ clipid = self._get_gc_clip_svg(gc)
+ if clipid is not None:
+ svg.append('<g clip-path="url(#%s)">\n' % clipid)
+
+ svg.append('<g style="fill: %s; opacity: %s" transform="' % (color, gc.get_alpha()))
if angle != 0:
svg.append('translate(%s,%s)rotate(%1.1f)' % (x,y,-angle))
elif x != 0 or y != 0:
@@ -332,16 +352,19 @@
kern = font.get_kerning(lastgind, gind, KERNING_DEFAULT)
else:
kern = 0
- lastgind = gind
- currx += kern/64.0
+ currx += (kern / 64.0) / (self.FONT_SCALE / fontsize)
svg.append('<use xlink:href="#%s"' % charnum)
if currx != 0:
svg.append(' x="%s"' %
(currx * (self.FONT_SCALE / fontsize)))
svg.append('/>\n')
+
currx += (glyph.linearHoriAdvance / 65536.0) / (self.FONT_SCALE / fontsize)
+ lastgind = gind
svg.append('</g>\n')
+ if clipid is not None:
+ svg.append('</g>\n')
svg = ''.join(svg)
else:
thetext = escape_xml_text(s)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-08 16:46:10
|
Revision: 5130
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5130&view=rev
Author: mdboom
Date: 2008-05-08 09:45:55 -0700 (Thu, 08 May 2008)
Log Message:
-----------
Fix kerning in SVG.
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-05-07 19:41:26 UTC (rev 5129)
+++ branches/v0_91_maint/CHANGELOG 2008-05-08 16:45:55 UTC (rev 5130)
@@ -1,3 +1,5 @@
+2008-05-08 Fix kerning in SVG when embedding character outlines - MGD
+
2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py 2008-05-07 19:41:26 UTC (rev 5129)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_svg.py 2008-05-08 16:45:55 UTC (rev 5130)
@@ -322,7 +322,7 @@
else:
kern = 0
lastgind = gind
- currx += kern/64.0
+ currx += kern/64.0 / (self.FONT_SCALE / fontsize)
svg.append('<use xlink:href="#%s"' % charnum)
if currx != 0:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-07 19:41:46
|
Revision: 5128
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5128&view=rev
Author: mdboom
Date: 2008-05-07 12:39:58 -0700 (Wed, 07 May 2008)
Log Message:
-----------
[ 1922569 ] gcc 4.3 C++ compilation errors (Thanks, Jef Spaleta)
Modified Paths:
--------------
branches/v0_91_maint/ttconv/pprdrv.h
branches/v0_91_maint/ttconv/pprdrv_tt.cpp
branches/v0_91_maint/ttconv/pprdrv_tt2.cpp
branches/v0_91_maint/ttconv/ttutil.cpp
Modified: branches/v0_91_maint/ttconv/pprdrv.h
===================================================================
--- branches/v0_91_maint/ttconv/pprdrv.h 2008-05-07 16:35:29 UTC (rev 5127)
+++ branches/v0_91_maint/ttconv/pprdrv.h 2008-05-07 19:39:58 UTC (rev 5128)
@@ -20,10 +20,10 @@
*/
#include <vector>
-#include <assert.h>
+#include <cassert>
/*
- * Encapsulates all of the output to write to an arbitrary output
+ * Encapsulates all of the output to write to an arbitrary output
* function. This both removes the hardcoding of output to go to stdout
* and makes output thread-safe. Michael Droettboom [06-07-07]
*/
@@ -36,7 +36,7 @@
public:
TTStreamWriter() { }
virtual ~TTStreamWriter() { }
-
+
virtual void write(const char*) = 0;
virtual void printf(const char* format, ...);
@@ -73,9 +73,9 @@
const char* getMessage() { return message; }
};
-/*
+/*
** No debug code will be included if this
-** is not defined:
+** is not defined:
*/
/* #define DEBUG 1 */
Modified: branches/v0_91_maint/ttconv/pprdrv_tt.cpp
===================================================================
--- branches/v0_91_maint/ttconv/pprdrv_tt.cpp 2008-05-07 16:35:29 UTC (rev 5127)
+++ branches/v0_91_maint/ttconv/pprdrv_tt.cpp 2008-05-07 19:39:58 UTC (rev 5128)
@@ -16,22 +16,22 @@
** documentation. This software is provided "as is" without express or
** implied warranty.
**
-** TrueType font support. These functions allow PPR to generate
+** TrueType font support. These functions allow PPR to generate
** PostScript fonts from Microsoft compatible TrueType font files.
**
** Last revised 19 December 1995.
*/
#include "global_defines.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include "pprdrv.h"
#include "truetype.h"
#include <sstream>
/*==========================================================================
-** Convert the indicated Truetype font file to a type 42 or type 3
+** Convert the indicated Truetype font file to a type 42 or type 3
** PostScript font and insert it in the output stream.
**
** All the routines from here to the end of file file are involved
@@ -42,7 +42,7 @@
** Endian conversion routines.
** These routines take a BYTE pointer
** and return a value formed by reading
-** bytes starting at that point.
+** bytes starting at that point.
**
** These routines read the big-endian
** values which are used in TrueType
@@ -55,14 +55,14 @@
ULONG getULONG(BYTE *p)
{
int x;
- ULONG val=0;
+ ULONG val=0;
for(x=0; x<4; x++)
{
val *= 0x100;
- val += p[x];
+ val += p[x];
}
-
+
return val;
} /* end of ftohULONG() */
@@ -72,14 +72,14 @@
USHORT getUSHORT(BYTE *p)
{
int x;
- USHORT val=0;
+ USHORT val=0;
for(x=0; x<2; x++)
{
val *= 0x100;
- val += p[x];
+ val += p[x];
}
-
+
return val;
} /* end of getUSHORT() */
@@ -92,7 +92,7 @@
Fixed val={0,0};
val.whole = ((s[0] * 256) + s[1]);
- val.fraction = ((s[2] * 256) + s[3]);
+ val.fraction = ((s[2] * 256) + s[3]);
return val;
} /* end of getFixed() */
@@ -102,16 +102,16 @@
** The font's "file" and "offset_table" fields must be set before this
** routine is called.
**
-** This first argument is a TrueType font structure, the second
+** This first argument is a TrueType font structure, the second
** argument is the name of the table to retrieve. A table name
-** is always 4 characters, though the last characters may be
+** is always 4 characters, though the last characters may be
** padding spaces.
-----------------------------------------------------------------------*/
BYTE *GetTable(struct TTFONT *font, const char *name)
{
BYTE *ptr;
ULONG x;
-
+
#ifdef DEBUG_TRUETYPE
debug("GetTable(file,font,\"%s\")",name);
#endif
@@ -127,17 +127,17 @@
BYTE *table;
offset = getULONG( ptr + 8 );
- length = getULONG( ptr + 12 );
+ length = getULONG( ptr + 12 );
table = (BYTE*)calloc( sizeof(BYTE), length );
try {
#ifdef DEBUG_TRUETYPE
debug("Loading table \"%s\" from offset %d, %d bytes",name,offset,length);
#endif
-
+
if( fseek( font->file, (long)offset, SEEK_SET ) )
throw TTException("TrueType font may be corrupt (reason 3)");
-
+
if( fread(table,sizeof(BYTE),length,font->file) != (sizeof(BYTE) * length))
throw TTException("TrueType font may be corrupt (reason 4)");
} catch (TTException& e) {
@@ -156,7 +156,7 @@
} /* end of GetTable() */
/*--------------------------------------------------------------------
-** Load the 'name' table, get information from it,
+** Load the 'name' table, get information from it,
** and store that information in the font structure.
**
** The 'name' table contains information such as the name of
@@ -171,7 +171,7 @@
int platform,encoding; /* Current platform id, encoding id, */
int language,nameid; /* language id, name id, */
int offset,length; /* offset and length of string. */
-
+
#ifdef DEBUG_TRUETYPE
debug("Read_name()");
#endif
@@ -188,7 +188,7 @@
try {
numrecords = getUSHORT( table_ptr + 2 ); /* number of names */
strings = table_ptr + getUSHORT( table_ptr + 4 ); /* start of string storage */
-
+
ptr2 = table_ptr + 6;
for(x=0; x < numrecords; x++,ptr2+=12)
{
@@ -202,7 +202,7 @@
#ifdef DEBUG_TRUETYPE
debug("platform %d, encoding %d, language 0x%x, name %d, offset %d, length %d",
platform,encoding,language,nameid,offset,length);
-#endif
+#endif
/* Copyright notice */
if( platform == 1 && nameid == 0 )
@@ -211,14 +211,14 @@
strncpy(font->Copyright,(const char*)strings+offset,length);
font->Copyright[length]=(char)NULL;
replace_newlines_with_spaces(font->Copyright);
-
+
#ifdef DEBUG_TRUETYPE
debug("font->Copyright=\"%s\"",font->Copyright);
#endif
continue;
}
-
+
/* Font Family name */
if( platform == 1 && nameid == 1 )
{
@@ -226,7 +226,7 @@
strncpy(font->FamilyName,(const char*)strings+offset,length);
font->FamilyName[length]=(char)NULL;
replace_newlines_with_spaces(font->FamilyName);
-
+
#ifdef DEBUG_TRUETYPE
debug("font->FamilyName=\"%s\"",font->FamilyName);
#endif
@@ -241,14 +241,14 @@
strncpy(font->Style,(const char*)strings+offset,length);
font->Style[length]=(char)NULL;
replace_newlines_with_spaces(font->Style);
-
+
#ifdef DEBUG_TRUETYPE
debug("font->Style=\"%s\"",font->Style);
#endif
continue;
}
-
-
+
+
/* Full Font name */
if( platform == 1 && nameid == 4 )
{
@@ -256,14 +256,14 @@
strncpy(font->FullName,(const char*)strings+offset,length);
font->FullName[length]=(char)NULL;
replace_newlines_with_spaces(font->FullName);
-
+
#ifdef DEBUG_TRUETYPE
debug("font->FullName=\"%s\"",font->FullName);
#endif
continue;
}
-
-
+
+
/* Version string */
if( platform == 1 && nameid == 5 )
{
@@ -277,8 +277,8 @@
#endif
continue;
}
-
-
+
+
/* PostScript name */
if( platform == 1 && nameid == 6 )
{
@@ -292,8 +292,8 @@
#endif
continue;
}
-
-
+
+
/* Trademark string */
if( platform == 1 && nameid == 7 )
{
@@ -301,13 +301,13 @@
strncpy(font->Trademark,(const char*)strings+offset,length);
font->Trademark[length]=(char)NULL;
replace_newlines_with_spaces(font->Trademark);
-
+
#ifdef DEBUG_TRUETYPE
debug("font->Trademark=\"%s\"",font->Trademark);
#endif
continue;
}
-
+
}
} catch (TTException& e) {
free(table_ptr);
@@ -443,20 +443,20 @@
/* Some information from the "post" table. */
ItalicAngle = getFixed( font->post_table + 4 );
stream.printf("/ItalicAngle %d.%d def\n",ItalicAngle.whole,ItalicAngle.fraction);
- stream.printf("/isFixedPitch %s def\n", getULONG( font->post_table + 12 ) ? "true" : "false" );
+ stream.printf("/isFixedPitch %s def\n", getULONG( font->post_table + 12 ) ? "true" : "false" );
stream.printf("/UnderlinePosition %d def\n", (int)getFWord( font->post_table + 8 ) );
- stream.printf("/UnderlineThickness %d def\n", (int)getFWord( font->post_table + 10 ) );
- stream.putline("end readonly def");
- } /* end of ttfont_FontInfo() */
+ stream.printf("/UnderlineThickness %d def\n", (int)getFWord( font->post_table + 10 ) );
+ stream.putline("end readonly def");
+ } /* end of ttfont_FontInfo() */
/*-------------------------------------------------------------------
** sfnts routines
-** These routines generate the PostScript "sfnts" array which
+** These routines generate the PostScript "sfnts" array which
** contains one or more strings which contain a reduced version
** of the TrueType font.
**
** A number of functions are required to accomplish this rather
-** complicated task.
+** complicated task.
-------------------------------------------------------------------*/
int string_len;
int line_len;
@@ -498,9 +498,9 @@
stream.putchar('\n');
line_len=0;
}
-
+
} /* end of sfnts_pputBYTE() */
-
+
/*
** Write a USHORT as a hexadecimal value as part of the sfnts array.
*/
@@ -516,7 +516,7 @@
void sfnts_pputULONG(TTStreamWriter& stream, ULONG n)
{
int x1,x2,x3;
-
+
x1 = n % 256;
n /= 256;
x2 = n % 256;
@@ -531,7 +531,7 @@
} /* end of sfnts_pputULONG() */
/*
-** This is called whenever it is
+** This is called whenever it is
** necessary to end a string in the sfnts array.
**
** (The array must be broken into strings which are
@@ -542,7 +542,7 @@
if(in_string)
{
string_len=0; /* fool sfnts_pputBYTE() */
-
+
#ifdef DEBUG_TRUETYPE_INLINE
puts("\n% dummy byte:\n");
#endif
@@ -562,7 +562,7 @@
*/
void sfnts_new_table(TTStreamWriter& stream, ULONG length)
{
- if( (string_len + length) > 65528 )
+ if( (string_len + length) > 65528 )
sfnts_end_string(stream);
} /* end of sfnts_new_table() */
@@ -615,7 +615,7 @@
/* Start new string if necessary. */
sfnts_new_table( stream, (int)length );
- /*
+ /*
** Make sure the glyph is padded out to a
** two byte boundary.
*/
@@ -627,16 +627,16 @@
{
if( (c = fgetc(font->file)) == EOF )
throw TTException("TrueType font may be corrupt (reason 6)");
-
+
sfnts_pputBYTE(stream, c);
total++; /* add to running total */
- }
+ }
}
free(font->loca_table);
font->loca_table = NULL;
-
+
/* Pad out to full length from table directory */
while( total < correct_total_length )
{
@@ -649,7 +649,7 @@
/*
** Here is the routine which ties it all together.
**
-** Create the array called "sfnts" which
+** Create the array called "sfnts" which
** holds the actual TrueType data.
*/
void ttfont_sfnts(TTStreamWriter& stream, struct TTFONT *font)
@@ -673,7 +673,7 @@
ULONG length;
ULONG checksum;
} tables[9];
-
+
BYTE *ptr; /* A pointer into the origional table directory. */
ULONG x,y; /* General use loop countes. */
int c; /* Input character. */
@@ -684,8 +684,8 @@
ptr = font->offset_table + 12;
nextoffset=0;
count=0;
-
- /*
+
+ /*
** Find the tables we want and store there vital
** statistics in tables[].
*/
@@ -697,7 +697,7 @@
if( diff > 0 ) /* If we are past it. */
{
tables[x].length = 0;
- diff = 0;
+ diff = 0;
}
else if( diff < 0 ) /* If we haven't hit it yet. */
{
@@ -711,12 +711,12 @@
tables[x].length = getULONG( ptr + 12 );
nextoffset += ( ((tables[x].length + 3) / 4) * 4 );
count++;
- ptr += 16;
+ ptr += 16;
}
} while(diff != 0);
-
+
} /* end of for loop which passes over the table directory */
-
+
/* Begin the sfnts array. */
sfnts_start(stream);
@@ -724,10 +724,10 @@
/* Start by copying the TrueType version number. */
ptr = font->offset_table;
for(x=0; x < 4; x++)
- {
+ {
sfnts_pputBYTE( stream, *(ptr++) );
}
-
+
/* Now, generate those silly numTables numbers. */
sfnts_pputUSHORT(stream, count); /* number of tables */
if( count == 9 )
@@ -735,11 +735,11 @@
sfnts_pputUSHORT(stream, 7); /* searchRange */
sfnts_pputUSHORT(stream, 3); /* entrySelector */
sfnts_pputUSHORT(stream, 81); /* rangeShift */
- }
+ }
#ifdef DEBUG_TRUETYPE
else
{
- debug("only %d tables selected",count);
+ debug("only %d tables selected",count);
}
#endif
@@ -754,13 +754,13 @@
sfnts_pputBYTE( stream, table_names[x][1] );
sfnts_pputBYTE( stream, table_names[x][2] );
sfnts_pputBYTE( stream, table_names[x][3] );
-
+
/* Checksum */
sfnts_pputULONG( stream, tables[x].checksum );
/* Offset */
sfnts_pputULONG( stream, tables[x].newoffset + 12 + (count * 16) );
-
+
/* Length */
sfnts_pputULONG( stream, tables[x].length );
}
@@ -770,7 +770,7 @@
{
if( tables[x].length == 0 ) /* skip tables that aren't there */
continue;
-
+
#ifdef DEBUG_TRUETYPE
debug("emmiting table '%s'",table_names[x]);
#endif
@@ -783,22 +783,22 @@
else /* Other tables may not exceed */
{ /* 65535 bytes in length. */
if( tables[x].length > 65535 )
- throw TTException("TrueType font has a table which is too long");
-
+ throw TTException("TrueType font has a table which is too long");
+
/* Start new string if necessary. */
sfnts_new_table(stream, tables[x].length);
/* Seek to proper position in the file. */
fseek( font->file, tables[x].oldoffset, SEEK_SET );
-
+
/* Copy the bytes of the table. */
for( y=0; y < tables[x].length; y++ )
{
if( (c = fgetc(font->file)) == EOF )
throw TTException("TrueType font may be corrupt (reason 7)");
-
+
sfnts_pputBYTE(stream, c);
- }
+ }
}
/* Padd it out to a four byte boundary. */
@@ -815,39 +815,39 @@
} /* End of loop for all tables */
/* Close the array. */
- sfnts_end_string(stream);
+ sfnts_end_string(stream);
stream.putline("]def");
} /* end of ttfont_sfnts() */
-
-/*--------------------------------------------------------------
-** Create the CharStrings dictionary which will translate
-** PostScript character names to TrueType font character
+
+/*--------------------------------------------------------------
+** Create the CharStrings dictionary which will translate
+** PostScript character names to TrueType font character
** indexes.
**
** If we are creating a type 3 instead of a type 42 font,
** this array will instead convert PostScript character names
** to executable proceedures.
--------------------------------------------------------------*/
-const char *Apple_CharStrings[]={
-".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign",
-"dollar","percent","ampersand","quotesingle","parenleft","parenright",
+const char *Apple_CharStrings[]={
+".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign",
+"dollar","percent","ampersand","quotesingle","parenleft","parenright",
"asterisk","plus", "comma","hyphen","period","slash","zero","one","two",
-"three","four","five","six","seven","eight","nine","colon","semicolon",
+"three","four","five","six","seven","eight","nine","colon","semicolon",
"less","equal","greater","question","at","A","B","C","D","E","F","G","H","I",
"J","K", "L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"bracketleft","backslash","bracketright","asciicircum","underscore","grave",
-"a","b","c","d","e","f","g","h","i","j","k", "l","m","n","o","p","q","r","s",
+"a","b","c","d","e","f","g","h","i","j","k", "l","m","n","o","p","q","r","s",
"t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde",
"Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis",
"aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla",
-"eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex",
+"eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex",
"idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde",
"uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent",
"sterling","section","bullet","paragraph","germandbls","registered",
"copyright","trademark","acute","dieresis","notequal","AE","Oslash",
"infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff",
"summation","product","pi","integral","ordfeminine","ordmasculine","Omega",
-"ae","oslash","questiondown","exclamdown","logicalnot","radical","florin",
+"ae","oslash","questiondown","exclamdown","logicalnot","radical","florin",
"approxequal","Delta","guillemotleft","guillemotright","ellipsis",
"nobreakspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash",
"quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge",
@@ -861,7 +861,7 @@
"Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior",
"twosuperior","threesuperior","onehalf","onequarter","threequarters","franc",
"Gbreve","gbreve","Idot","Scedilla","scedilla","Cacute","cacute","Ccaron",
-"ccaron","dmacron","markingspace","capslock","shift","propeller","enter",
+"ccaron","dmacron","markingspace","capslock","shift","propeller","enter",
"markingtabrtol","markingtabltor","control","markingdeleteltor",
"markingdeletertol","option","escape","parbreakltor","parbreakrtol",
"newpage","checkmark","linebreakltor","linebreakrtol","markingnobreakspace",
@@ -879,7 +879,7 @@
ULONG len;
GlyphIndex = (int)getUSHORT( font->post_table + 34 + (charindex * 2) );
-
+
if( GlyphIndex <= 257 ) /* If a standard Apple name, */
{
return Apple_CharStrings[GlyphIndex];
@@ -887,7 +887,7 @@
else /* Otherwise, use one */
{ /* of the pascal strings. */
GlyphIndex -= 258;
-
+
/* Set pointer to start of Pascal strings. */
ptr = (char*)(font->post_table + 34 + (font->numGlyphs * 2));
@@ -897,7 +897,7 @@
ptr += len;
len = (ULONG)*(ptr++);
}
-
+
if( len >= sizeof(temp) )
throw TTException("TrueType font file contains a very long PostScript name");
@@ -914,16 +914,16 @@
void ttfont_CharStrings(TTStreamWriter& stream, struct TTFONT *font, std::vector<int>& glyph_ids)
{
Fixed post_format;
-
+
/* The 'post' table format number. */
post_format = getFixed( font->post_table );
-
+
if( post_format.whole != 2 || post_format.fraction != 0 )
throw TTException("TrueType fontdoes not have a format 2.0 'post' table");
/* Emmit the start of the PostScript code to define the dictionary. */
stream.printf("/CharStrings %d dict dup begin\n", glyph_ids.size());
-
+
/* Emmit one key-value pair for each glyph. */
for(std::vector<int>::const_iterator i = glyph_ids.begin();
i != glyph_ids.end(); ++i)
@@ -935,13 +935,13 @@
else /* type 3 */
{
stream.printf("/%s{",ttfont_CharStrings_getname(font, *i));
-
+
tt_type3_charproc(stream, font, *i);
-
+
stream.putline("}_d"); /* "} bind def" */
}
}
-
+
stream.putline("end readonly def");
} /* end of ttfont_CharStrings() */
@@ -971,8 +971,8 @@
stream.putline("/BuildChar {");
stream.putline(" 1 index /Encoding get exch get");
stream.putline(" 1 index /BuildGlyph get exec");
- stream.putline("}_d");
-
+ stream.putline("}_d");
+
stream.putchar('\n');
}
@@ -999,7 +999,7 @@
stream.putline("{/TrueDict where{pop}{(%%[ Error: no TrueType rasterizer ]%%)= flush}ifelse");
/* Since we are expected to use Apple's TrueDict TrueType */
- /* reasterizer, change the font type to 3. */
+ /* reasterizer, change the font type to 3. */
stream.putline("/FontType 3 def");
/* Define a string to hold the state of the Apple */
@@ -1035,7 +1035,7 @@
/* Exchange the CharStrings dictionary and the charname, */
/* but if the answer was false, replace the character name */
- /* with ".notdef". */
+ /* with ".notdef". */
stream.putline(" {exch}{exch pop /.notdef}ifelse");
/* stack: CharStrings charname */
@@ -1060,7 +1060,7 @@
stream.putline(" /BuildChar{");
stream.putline(" 1 index /Encoding get exch get");
stream.putline(" 1 index /BuildGlyph get exec");
- stream.putline(" }bind def");
+ stream.putline(" }bind def");
/* Here we close the condition which is true */
/* if the printer has no built-in TrueType */
@@ -1071,7 +1071,7 @@
stream.putline("FontName currentdict end definefont pop");
stream.putline("%%EOF");
- } /* end of ttfont_trailer() */
+ } /* end of ttfont_trailer() */
/*------------------------------------------------------------------
** This is the externally callable routine which inserts the font.
@@ -1080,7 +1080,7 @@
void read_font(const char *filename, font_type_enum target_type, std::vector<int>& glyph_ids, TTFONT& font)
{
BYTE *ptr;
-
+
/* Decide what type of PostScript font we will be generating. */
font.target_type = target_type;
@@ -1094,24 +1094,24 @@
/* Allocate space for the unvarying part of the offset table. */
assert(font.offset_table == NULL);
font.offset_table = (BYTE*)calloc( 12, sizeof(BYTE) );
-
+
/* Read the first part of the offset table. */
if( fread( font.offset_table, sizeof(BYTE), 12, font.file ) != 12 )
throw TTException("TrueType font may be corrupt (reason 1)");
-
+
/* Determine how many directory entries there are. */
font.numTables = getUSHORT( font.offset_table + 4 );
#ifdef DEBUG_TRUETYPE
debug("numTables=%d",(int)font.numTables);
#endif
-
+
/* Expand the memory block to hold the whole thing. */
font.offset_table = (BYTE*)realloc( font.offset_table, sizeof(BYTE) * (12 + font.numTables * 16) );
-
+
/* Read the rest of the table directory. */
if( fread( font.offset_table + 12, sizeof(BYTE), (font.numTables*16), font.file ) != (font.numTables*16) )
throw TTException("TrueType font may be corrupt (reason 2)");
-
+
/* Extract information from the "Offset" table. */
font.TTVersion = getFixed( font.offset_table );
@@ -1177,7 +1177,7 @@
} /* end of insert_ttfont() */
-void insert_ttfont(const char *filename, TTStreamWriter& stream,
+void insert_ttfont(const char *filename, TTStreamWriter& stream,
font_type_enum target_type, std::vector<int>& glyph_ids)
{
struct TTFONT font;
@@ -1233,9 +1233,9 @@
}
TTFONT::TTFONT() :
- file(NULL),
+ file(NULL),
PostName(NULL),
- FullName(NULL),
+ FullName(NULL),
FamilyName(NULL),
Style(NULL),
Copyright(NULL),
Modified: branches/v0_91_maint/ttconv/pprdrv_tt2.cpp
===================================================================
--- branches/v0_91_maint/ttconv/pprdrv_tt2.cpp 2008-05-07 16:35:29 UTC (rev 5127)
+++ branches/v0_91_maint/ttconv/pprdrv_tt2.cpp 2008-05-07 19:39:58 UTC (rev 5128)
@@ -16,14 +16,14 @@
** documentation. This software is provided "as is" without express or
** implied warranty.
**
-** TrueType font support. These functions allow PPR to generate
+** TrueType font support. These functions allow PPR to generate
** PostScript fonts from Microsoft compatible TrueType font files.
**
** The functions in this file do most of the work to convert a
** TrueType font to a type 3 PostScript font.
**
** Most of the material in this file is derived from a program called
-** "ttf2ps" which L. S. Ng posted to the usenet news group
+** "ttf2ps" which L. S. Ng posted to the usenet news group
** "comp.sources.postscript". The author did not provide a copyright
** notice or indicate any restrictions on use.
**
@@ -31,11 +31,11 @@
*/
#include "global_defines.h"
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <memory.h>
-#include "pprdrv.h"
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+#include "pprdrv.h"
#include "truetype.h"
#include <algorithm>
#include <stack>
@@ -59,7 +59,7 @@
int *ctrset; /* in contour index followed by out contour index */
int stack_depth; /* A book-keeping variable for keeping track of the depth of the PS stack */
-
+
bool pdf_mode;
void load_char(TTFONT* font, BYTE *glyph);
@@ -88,7 +88,7 @@
/*
** This routine is used to break the character
-** procedure up into a number of smaller
+** procedure up into a number of smaller
** procedures. This is necessary so as not to
** overflow the stack on certain level 1 interpreters.
**
@@ -131,21 +131,21 @@
** Find the area of a contour?
*/
double area(FWord *x, FWord *y, int n)
- {
+ {
int i;
double sum;
-
+
sum=x[n-1]*y[0]-y[n-1]*x[0];
for (i=0; i<=n-2; i++) sum += x[i]*y[i+1] - y[i]*x[i+1];
return sum;
- }
+ }
/*
** We call this routine to emmit the PostScript code
** for the character we have loaded with load_char().
*/
void GlyphToType3::PSConvert(TTStreamWriter& stream)
- {
+ {
int i,j,k,fst,start_offpt;
int end_offpt = 0;
@@ -162,10 +162,10 @@
check_ctr[0]=1;
area_ctr[0]=area(xcoor, ycoor, epts_ctr[0]+1);
- for (i=1; i<num_ctr; i++)
+ for (i=1; i<num_ctr; i++)
area_ctr[i]=area(xcoor+epts_ctr[i-1]+1, ycoor+epts_ctr[i-1]+1, epts_ctr[i]-epts_ctr[i-1]);
- for (i=0; i<num_ctr; i++)
+ for (i=0; i<num_ctr; i++)
{
if (area_ctr[i]>0)
{
@@ -254,26 +254,26 @@
{
int j;
- for(j=0; j<num_ctr; j++)
+ for(j=0; j<num_ctr; j++)
if (check_ctr[j]==0 && area_ctr[j] < 0) {
check_ctr[j]=1;
return j;
}
-
+
return NOMOREOUTCTR;
} /* end of nextoutctr() */
int GlyphToType3::nextinctr(int co, int ci)
{
int j;
-
+
for(j=0; j<num_ctr; j++)
- if (ctrset[2*j+1]==co)
+ if (ctrset[2*j+1]==co)
if (check_ctr[ctrset[2*j]]==0) {
check_ctr[ctrset[2*j]]=1;
return ctrset[2*j];
}
-
+
return NOMOREINCTR;
}
@@ -285,8 +285,8 @@
int k = 0; /* !!! is this right? */
int co;
double a, a1=0;
-
- for (co=0; co < num_ctr; co++)
+
+ for (co=0; co < num_ctr; co++)
{
if(area_ctr[co] < 0)
{
@@ -303,7 +303,7 @@
}
}
}
-
+
return k;
} /* end of nearout() */
@@ -312,14 +312,14 @@
int i, j, start, end;
double r1, r2, a;
FWord xi[3], yi[3];
-
+
j=start=(co==0)?0:(epts_ctr[co-1]+1);
end=epts_ctr[co];
i=(ci==0)?0:(epts_ctr[ci-1]+1);
xi[0] = xcoor[i];
yi[0] = ycoor[i];
r1=sqr(xcoor[start] - xi[0]) + sqr(ycoor[start] - yi[0]);
-
+
for (i=start; i<=end; i++) {
r2 = sqr(xcoor[i] - xi[0])+sqr(ycoor[i] - yi[0]);
if (r2 < r1) {
@@ -331,17 +331,17 @@
if (j==start) { xi[1]=xcoor[end]; yi[1]=ycoor[end]; }
if (j==end) { xi[2]=xcoor[start]; yi[2]=ycoor[start]; }
a=area(xi, yi, 3);
-
+
return a;
} /* end of intest() */
void GlyphToType3::PSMoveto(TTStreamWriter& stream, int x, int y) {
- stream.printf(pdf_mode ? "%d %d m\n" : "%d %d _m\n",
+ stream.printf(pdf_mode ? "%d %d m\n" : "%d %d _m\n",
x, y);
}
void GlyphToType3::PSLineto(TTStreamWriter& stream, int x, int y) {
- stream.printf(pdf_mode ? "%d %d l\n" : "%d %d _l\n",
+ stream.printf(pdf_mode ? "%d %d l\n" : "%d %d _l\n",
x, y);
}
@@ -369,8 +369,8 @@
cx[2] = (sx[2]+2*sx[1])/3;
cy[2] = (sy[2]+2*sy[1])/3;
- stream.printf(pdf_mode ?
- "%d %d %d %d %d %d c\n" :
+ stream.printf(pdf_mode ?
+ "%d %d %d %d %d %d c\n" :
"%d %d %d %d %d %d _c\n",
(int)cx[1], (int)cy[1], (int)cx[2], (int)cy[2],
(int)cx[3], (int)cy[3]);
@@ -513,22 +513,22 @@
USHORT yscale;
USHORT scale01;
USHORT scale10;
-
+
/* Once around this loop for each component. */
do {
- flags = getUSHORT(glyph); /* read the flags word */
+ flags = getUSHORT(glyph); /* read the flags word */
glyph += 2;
glyphIndex = getUSHORT(glyph); /* read the glyphindex word */
glyph += 2;
-
+
if(flags & ARG_1_AND_2_ARE_WORDS)
{ /* The tt spec. seems to say these are signed. */
arg1 = getSHORT(glyph);
glyph += 2;
arg2 = getSHORT(glyph);
glyph += 2;
- }
+ }
else /* The tt spec. does not clearly indicate */
{ /* whether these values are signed or not. */
arg1 = *(glyph++);
@@ -538,7 +538,7 @@
if(flags & WE_HAVE_A_SCALE)
{
xscale = yscale = getUSHORT(glyph);
- glyph += 2;
+ glyph += 2;
scale01 = scale10 = 0;
}
else if(flags & WE_HAVE_AN_X_AND_Y_SCALE)
@@ -548,7 +548,7 @@
yscale = getUSHORT(glyph);
glyph += 2;
scale01 = scale10 = 0;
- }
+ }
else if(flags & WE_HAVE_A_TWO_BY_TWO)
{
xscale = getUSHORT(glyph);
@@ -597,20 +597,20 @@
{
stream.printf("%% unimplemented shift, arg1=%d, arg2=%d\n",arg1,arg2);
}
-
+
/* Invoke the CharStrings procedure to print the component. */
stream.printf("false CharStrings /%s get exec\n",
ttfont_CharStrings_getname(font,glyphIndex));
-
+
/* If we translated the coordinate system, */
/* put it back the way it was. */
if( flags & ARGS_ARE_XY_VALUES && (arg1 != 0 || arg2 != 0) ) {
stream.puts("grestore ");
}
}
-
+
} while(flags & MORE_COMPONENTS);
-
+
} /* end of do_composite() */
/*
@@ -676,7 +676,7 @@
llx = getFWord(glyph + 2);
lly = getFWord(glyph + 4);
urx = getFWord(glyph + 6);
- ury = getFWord(glyph + 8);
+ ury = getFWord(glyph + 8);
/* Advance the pointer. */
glyph += 10;
@@ -691,7 +691,7 @@
/* Consult the horizontal metrics table to determine */
/* the character width. */
if( charindex < font->numberOfHMetrics )
- advance_width = getuFWord( font->hmtx_table + (charindex * 4) );
+ advance_width = getuFWord( font->hmtx_table + (charindex * 4) );
else
advance_width = getuFWord( font->hmtx_table + ((font->numberOfHMetrics-1) * 4) );
@@ -718,7 +718,7 @@
{
do_composite(stream, font, glyph);
}
-
+
stack_end(stream);
}
@@ -763,16 +763,16 @@
gind = (int)getUSHORT(glyph);
glyph += 2;
- std::vector<int>::iterator insertion =
+ std::vector<int>::iterator insertion =
std::lower_bound(glyph_ids.begin(), glyph_ids.end(), gind);
if (*insertion != gind) {
glyph_ids.insert(insertion, gind);
glyph_stack.push(gind);
}
-
+
if (flags & ARG_1_AND_2_ARE_WORDS)
glyph += 4;
- else
+ else
glyph += 2;
if (flags & WE_HAVE_A_SCALE)
Modified: branches/v0_91_maint/ttconv/ttutil.cpp
===================================================================
--- branches/v0_91_maint/ttconv/ttutil.cpp 2008-05-07 16:35:29 UTC (rev 5127)
+++ branches/v0_91_maint/ttconv/ttutil.cpp 2008-05-07 19:39:58 UTC (rev 5128)
@@ -8,9 +8,9 @@
/* (c) Frank Siegert 1996 */
#include "global_defines.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdarg>
+#include <cstdlib>
#include "pprdrv.h"
#if DEBUG_TRUETYPE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-07 19:41:39
|
Revision: 5129
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5129&view=rev
Author: mdboom
Date: 2008-05-07 12:41:26 -0700 (Wed, 07 May 2008)
Log Message:
-----------
Merged revisions 5124-5128 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5128 | mdboom | 2008-05-07 15:39:58 -0400 (Wed, 07 May 2008) | 2 lines
[ 1922569 ] gcc 4.3 C++ compilation errors (Thanks, Jef Spaleta)
........
Modified Paths:
--------------
trunk/matplotlib/ttconv/pprdrv.h
trunk/matplotlib/ttconv/pprdrv_tt.cpp
trunk/matplotlib/ttconv/pprdrv_tt2.cpp
trunk/matplotlib/ttconv/ttutil.cpp
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5123
+ /branches/v0_91_maint:1-5128
Modified: trunk/matplotlib/ttconv/pprdrv.h
===================================================================
--- trunk/matplotlib/ttconv/pprdrv.h 2008-05-07 19:39:58 UTC (rev 5128)
+++ trunk/matplotlib/ttconv/pprdrv.h 2008-05-07 19:41:26 UTC (rev 5129)
@@ -20,10 +20,10 @@
*/
#include <vector>
-#include <assert.h>
+#include <cassert>
/*
- * Encapsulates all of the output to write to an arbitrary output
+ * Encapsulates all of the output to write to an arbitrary output
* function. This both removes the hardcoding of output to go to stdout
* and makes output thread-safe. Michael Droettboom [06-07-07]
*/
@@ -36,7 +36,7 @@
public:
TTStreamWriter() { }
virtual ~TTStreamWriter() { }
-
+
virtual void write(const char*) = 0;
virtual void printf(const char* format, ...);
@@ -73,9 +73,9 @@
const char* getMessage() { return message; }
};
-/*
+/*
** No debug code will be included if this
-** is not defined:
+** is not defined:
*/
/* #define DEBUG 1 */
Modified: trunk/matplotlib/ttconv/pprdrv_tt.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt.cpp 2008-05-07 19:39:58 UTC (rev 5128)
+++ trunk/matplotlib/ttconv/pprdrv_tt.cpp 2008-05-07 19:41:26 UTC (rev 5129)
@@ -23,9 +23,9 @@
*/
#include "global_defines.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include "pprdrv.h"
#include "truetype.h"
#include <sstream>
Modified: trunk/matplotlib/ttconv/pprdrv_tt2.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt2.cpp 2008-05-07 19:39:58 UTC (rev 5128)
+++ trunk/matplotlib/ttconv/pprdrv_tt2.cpp 2008-05-07 19:41:26 UTC (rev 5129)
@@ -16,14 +16,14 @@
** documentation. This software is provided "as is" without express or
** implied warranty.
**
-** TrueType font support. These functions allow PPR to generate
+** TrueType font support. These functions allow PPR to generate
** PostScript fonts from Microsoft compatible TrueType font files.
**
** The functions in this file do most of the work to convert a
** TrueType font to a type 3 PostScript font.
**
** Most of the material in this file is derived from a program called
-** "ttf2ps" which L. S. Ng posted to the usenet news group
+** "ttf2ps" which L. S. Ng posted to the usenet news group
** "comp.sources.postscript". The author did not provide a copyright
** notice or indicate any restrictions on use.
**
@@ -31,11 +31,11 @@
*/
#include "global_defines.h"
-#include <math.h>
-#include <stdlib.h>
-#include <string.h>
-#include <memory.h>
-#include "pprdrv.h"
+#include <cmath>
+#include <cstdlib>
+#include <cstring>
+#include <memory>
+#include "pprdrv.h"
#include "truetype.h"
#include <algorithm>
#include <stack>
@@ -59,7 +59,7 @@
int *ctrset; /* in contour index followed by out contour index */
int stack_depth; /* A book-keeping variable for keeping track of the depth of the PS stack */
-
+
bool pdf_mode;
void load_char(TTFONT* font, BYTE *glyph);
@@ -88,7 +88,7 @@
/*
** This routine is used to break the character
-** procedure up into a number of smaller
+** procedure up into a number of smaller
** procedures. This is necessary so as not to
** overflow the stack on certain level 1 interpreters.
**
@@ -131,21 +131,21 @@
** Find the area of a contour?
*/
double area(FWord *x, FWord *y, int n)
- {
+ {
int i;
double sum;
-
+
sum=x[n-1]*y[0]-y[n-1]*x[0];
for (i=0; i<=n-2; i++) sum += x[i]*y[i+1] - y[i]*x[i+1];
return sum;
- }
+ }
/*
** We call this routine to emmit the PostScript code
** for the character we have loaded with load_char().
*/
void GlyphToType3::PSConvert(TTStreamWriter& stream)
- {
+ {
int i,j,k,fst,start_offpt;
int end_offpt = 0;
@@ -162,10 +162,10 @@
check_ctr[0]=1;
area_ctr[0]=area(xcoor, ycoor, epts_ctr[0]+1);
- for (i=1; i<num_ctr; i++)
+ for (i=1; i<num_ctr; i++)
area_ctr[i]=area(xcoor+epts_ctr[i-1]+1, ycoor+epts_ctr[i-1]+1, epts_ctr[i]-epts_ctr[i-1]);
- for (i=0; i<num_ctr; i++)
+ for (i=0; i<num_ctr; i++)
{
if (area_ctr[i]>0)
{
@@ -254,26 +254,26 @@
{
int j;
- for(j=0; j<num_ctr; j++)
+ for(j=0; j<num_ctr; j++)
if (check_ctr[j]==0 && area_ctr[j] < 0) {
check_ctr[j]=1;
return j;
}
-
+
return NOMOREOUTCTR;
} /* end of nextoutctr() */
int GlyphToType3::nextinctr(int co, int ci)
{
int j;
-
+
for(j=0; j<num_ctr; j++)
- if (ctrset[2*j+1]==co)
+ if (ctrset[2*j+1]==co)
if (check_ctr[ctrset[2*j]]==0) {
check_ctr[ctrset[2*j]]=1;
return ctrset[2*j];
}
-
+
return NOMOREINCTR;
}
@@ -285,8 +285,8 @@
int k = 0; /* !!! is this right? */
int co;
double a, a1=0;
-
- for (co=0; co < num_ctr; co++)
+
+ for (co=0; co < num_ctr; co++)
{
if(area_ctr[co] < 0)
{
@@ -303,7 +303,7 @@
}
}
}
-
+
return k;
} /* end of nearout() */
@@ -312,14 +312,14 @@
int i, j, start, end;
double r1, r2, a;
FWord xi[3], yi[3];
-
+
j=start=(co==0)?0:(epts_ctr[co-1]+1);
end=epts_ctr[co];
i=(ci==0)?0:(epts_ctr[ci-1]+1);
xi[0] = xcoor[i];
yi[0] = ycoor[i];
r1=sqr(xcoor[start] - xi[0]) + sqr(ycoor[start] - yi[0]);
-
+
for (i=start; i<=end; i++) {
r2 = sqr(xcoor[i] - xi[0])+sqr(ycoor[i] - yi[0]);
if (r2 < r1) {
@@ -331,17 +331,17 @@
if (j==start) { xi[1]=xcoor[end]; yi[1]=ycoor[end]; }
if (j==end) { xi[2]=xcoor[start]; yi[2]=ycoor[start]; }
a=area(xi, yi, 3);
-
+
return a;
} /* end of intest() */
void GlyphToType3::PSMoveto(TTStreamWriter& stream, int x, int y) {
- stream.printf(pdf_mode ? "%d %d m\n" : "%d %d _m\n",
+ stream.printf(pdf_mode ? "%d %d m\n" : "%d %d _m\n",
x, y);
}
void GlyphToType3::PSLineto(TTStreamWriter& stream, int x, int y) {
- stream.printf(pdf_mode ? "%d %d l\n" : "%d %d _l\n",
+ stream.printf(pdf_mode ? "%d %d l\n" : "%d %d _l\n",
x, y);
}
@@ -369,8 +369,8 @@
cx[2] = (sx[2]+2*sx[1])/3;
cy[2] = (sy[2]+2*sy[1])/3;
- stream.printf(pdf_mode ?
- "%d %d %d %d %d %d c\n" :
+ stream.printf(pdf_mode ?
+ "%d %d %d %d %d %d c\n" :
"%d %d %d %d %d %d _c\n",
(int)cx[1], (int)cy[1], (int)cx[2], (int)cy[2],
(int)cx[3], (int)cy[3]);
@@ -513,22 +513,22 @@
USHORT yscale;
USHORT scale01;
USHORT scale10;
-
+
/* Once around this loop for each component. */
do {
- flags = getUSHORT(glyph); /* read the flags word */
+ flags = getUSHORT(glyph); /* read the flags word */
glyph += 2;
glyphIndex = getUSHORT(glyph); /* read the glyphindex word */
glyph += 2;
-
+
if(flags & ARG_1_AND_2_ARE_WORDS)
{ /* The tt spec. seems to say these are signed. */
arg1 = getSHORT(glyph);
glyph += 2;
arg2 = getSHORT(glyph);
glyph += 2;
- }
+ }
else /* The tt spec. does not clearly indicate */
{ /* whether these values are signed or not. */
arg1 = *(glyph++);
@@ -538,7 +538,7 @@
if(flags & WE_HAVE_A_SCALE)
{
xscale = yscale = getUSHORT(glyph);
- glyph += 2;
+ glyph += 2;
scale01 = scale10 = 0;
}
else if(flags & WE_HAVE_AN_X_AND_Y_SCALE)
@@ -548,7 +548,7 @@
yscale = getUSHORT(glyph);
glyph += 2;
scale01 = scale10 = 0;
- }
+ }
else if(flags & WE_HAVE_A_TWO_BY_TWO)
{
xscale = getUSHORT(glyph);
@@ -597,20 +597,20 @@
{
stream.printf("%% unimplemented shift, arg1=%d, arg2=%d\n",arg1,arg2);
}
-
+
/* Invoke the CharStrings procedure to print the component. */
stream.printf("false CharStrings /%s get exec\n",
ttfont_CharStrings_getname(font,glyphIndex));
-
+
/* If we translated the coordinate system, */
/* put it back the way it was. */
if( flags & ARGS_ARE_XY_VALUES && (arg1 != 0 || arg2 != 0) ) {
stream.puts("grestore ");
}
}
-
+
} while(flags & MORE_COMPONENTS);
-
+
} /* end of do_composite() */
/*
@@ -676,7 +676,7 @@
llx = getFWord(glyph + 2);
lly = getFWord(glyph + 4);
urx = getFWord(glyph + 6);
- ury = getFWord(glyph + 8);
+ ury = getFWord(glyph + 8);
/* Advance the pointer. */
glyph += 10;
@@ -691,7 +691,7 @@
/* Consult the horizontal metrics table to determine */
/* the character width. */
if( charindex < font->numberOfHMetrics )
- advance_width = getuFWord( font->hmtx_table + (charindex * 4) );
+ advance_width = getuFWord( font->hmtx_table + (charindex * 4) );
else
advance_width = getuFWord( font->hmtx_table + ((font->numberOfHMetrics-1) * 4) );
@@ -718,7 +718,7 @@
{
do_composite(stream, font, glyph);
}
-
+
stack_end(stream);
}
@@ -763,16 +763,16 @@
gind = (int)getUSHORT(glyph);
glyph += 2;
- std::vector<int>::iterator insertion =
+ std::vector<int>::iterator insertion =
std::lower_bound(glyph_ids.begin(), glyph_ids.end(), gind);
if (*insertion != gind) {
glyph_ids.insert(insertion, gind);
glyph_stack.push(gind);
}
-
+
if (flags & ARG_1_AND_2_ARE_WORDS)
glyph += 4;
- else
+ else
glyph += 2;
if (flags & WE_HAVE_A_SCALE)
Modified: trunk/matplotlib/ttconv/ttutil.cpp
===================================================================
--- trunk/matplotlib/ttconv/ttutil.cpp 2008-05-07 19:39:58 UTC (rev 5128)
+++ trunk/matplotlib/ttconv/ttutil.cpp 2008-05-07 19:41:26 UTC (rev 5129)
@@ -8,9 +8,9 @@
/* (c) Frank Siegert 1996 */
#include "global_defines.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdarg>
+#include <cstdlib>
#include "pprdrv.h"
#if DEBUG_TRUETYPE
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-07 16:37:10
|
Revision: 5127
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5127&view=rev
Author: mdboom
Date: 2008-05-07 09:35:29 -0700 (Wed, 07 May 2008)
Log Message:
-----------
Update radio buttons to new transformation framework (thanks Matthias Michler)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/widgets.py
Modified: trunk/matplotlib/lib/matplotlib/widgets.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/widgets.py 2008-05-07 10:41:42 UTC (rev 5126)
+++ trunk/matplotlib/lib/matplotlib/widgets.py 2008-05-07 16:35:29 UTC (rev 5127)
@@ -459,7 +459,7 @@
def _clicked(self, event):
if event.button !=1 : return
if event.inaxes != self.ax: return
- xy = self.ax.transAxes.inverse_xy_tup((event.x, event.y))
+ xy = self.ax.transAxes.inverted().transform_point((event.x, event.y))
pclicked = np.array([xy[0], xy[1]])
def inside(p):
pcirc = np.array([p.center[0], p.center[1]])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-05-07 10:41:46
|
Revision: 5126
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5126&view=rev
Author: mmetz_bn
Date: 2008-05-07 03:41:42 -0700 (Wed, 07 May 2008)
Log Message:
-----------
Switched to future numpy histogram semantic in hist
Modified Paths:
--------------
trunk/matplotlib/API_CHANGES
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/API_CHANGES
===================================================================
--- trunk/matplotlib/API_CHANGES 2008-05-07 02:12:31 UTC (rev 5125)
+++ trunk/matplotlib/API_CHANGES 2008-05-07 10:41:42 UTC (rev 5126)
@@ -1,3 +1,9 @@
+ In numpy 1.0 bins are specified by the left edges only. The axes
+ method "hist" now uses future numpy 1.3 semantic for histograms.
+ Providing binedges, the last value gives the upper-right edge now,
+ which was implicitly set to +infinity in numpy 1.0. This also means
+ that the last bin doesn't contain upper outliers any more by default.
+
New axes method and pyplot function, hexbin, is an alternative
to scatter for large datasets. It makes something like a
pcolor of a 2-D histogram, but uses hexagonal bins.
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-07 02:12:31 UTC (rev 5125)
+++ trunk/matplotlib/CHANGELOG 2008-05-07 10:41:42 UTC (rev 5126)
@@ -1,3 +1,5 @@
+2008-05-07 Switched to future numpy histogram semantic in hist - MM
+
2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
2008-05-05 pass notify_axes_change to the figure's add_axobserver
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-07 02:12:31 UTC (rev 5125)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-07 10:41:42 UTC (rev 5126)
@@ -5406,11 +5406,11 @@
#### Data analysis
- def hist(self, x, bins=10, normed=0, bottom=None, histtype='bar',
+ def hist(self, x, bins=10, normed=False, bottom=None, histtype='bar',
align='edge', orientation='vertical', width=None,
log=False, **kwargs):
"""
- HIST(x, bins=10, normed=0, bottom=None, histtype='bar',
+ HIST(x, bins=10, normed=False, bottom=None, histtype='bar',
align='edge', orientation='vertical', width=None,
log=False, **kwargs)
@@ -5449,40 +5449,35 @@
%(Rectangle)s
"""
if not self._hold: self.cla()
- n, bins = np.histogram(x, bins, range=None, normed=normed)
- if width is None:
- if histtype == 'bar':
- width = 0.9*(bins[1]-bins[0])
- elif histtype == 'step':
- width = bins[1]-bins[0]
- else:
- raise ValueError, 'invalid histtype: %s' % histtype
+ n, bins = np.histogram(x, bins, range=None,
+ normed=bool(normed), new=True)
if histtype == 'bar':
+ if width is None:
+ width = 0.9*(bins[1]-bins[0])
+
if orientation == 'horizontal':
- patches = self.barh(bins, n, height=width, left=bottom,
+ patches = self.barh(bins[:-1], n, height=width, left=bottom,
align=align, log=log)
elif orientation == 'vertical':
- patches = self.bar(bins, n, width=width, bottom=bottom,
+ patches = self.bar(bins[:-1], n, width=width, bottom=bottom,
align=align, log=log)
else:
raise ValueError, 'invalid orientation: %s' % orientation
elif histtype == 'step':
- binedges = np.concatenate((bins,bins[-1:]+width))
+ x = np.zeros( 2*len(bins), np.float_ )
+ y = np.zeros( 2*len(bins), np.float_ )
+
+ x[0::2], x[1::2] = bins, bins
+ y[1:-1:2], y[2::2] = n, n
+
if align == 'center':
- binedges -= 0.5*width
- x = np.zeros( 2*len(binedges), np.float_ )
- y = np.zeros( 2*len(binedges), np.float_ )
+ x -= 0.5*(bins[1]-bins[0])
- x[0:-1:2],x[1::2] = binedges, binedges
- y[1:-1:2],y[2::2] = n, n
-
if orientation == 'horizontal':
x,y = y,x
- elif orientation == 'vertical':
- pass
- else:
+ elif orientation != 'vertical':
raise ValueError, 'invalid orientation: %s' % orientation
patches = self.fill(x,y)
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-05-07 02:12:33
|
Revision: 5125
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5125&view=rev
Author: efiring
Date: 2008-05-06 19:12:31 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Fix broken memleak link
Modified Paths:
--------------
trunk/htdocs/faq.html.template
Modified: trunk/htdocs/faq.html.template
===================================================================
--- trunk/htdocs/faq.html.template 2008-05-06 19:03:54 UTC (rev 5124)
+++ trunk/htdocs/faq.html.template 2008-05-07 02:12:31 UTC (rev 5125)
@@ -906,7 +906,7 @@
The unit directory of the source tree contains an example scripts
useful for diagnosing and reporting memory leaks. For
-example, <a href="http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/unit/memleak_hawaii.py?view=markup"><tt>memleak_hawaii.py</tt></a>
+example, <a href="http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/unit/memleak_hawaii3.py?view=markup"><tt>memleak_hawaii.py</tt></a>
is useful for finding plotting-related memory leaks,
and <a href="http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/unit/memleak_gui.py?view=markup"><tt>memleak_gui.py</tt></a>
helps find memory leaks in the GUI-backend. Please use
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-06 19:04:08
|
Revision: 5124
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5124&view=rev
Author: mdboom
Date: 2008-05-06 12:03:54 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Merged revisions 5122-5123 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5123 | mdboom | 2008-05-06 14:56:47 -0400 (Tue, 06 May 2008) | 2 lines
Fixing bugs in recent changes to Qt blitting.
........
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5121
+ /branches/v0_91_maint:1-5123
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-05-06 18:56:47 UTC (rev 5123)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-05-06 19:03:54 UTC (rev 5124)
@@ -93,26 +93,28 @@
Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) {
// owned=true to prevent memory leak
Py_ssize_t length;
- char* pix;
- char* begin;
- char* end;
- char tmp;
+ unsigned char* pix;
+ unsigned char* begin;
+ unsigned char* end;
+ unsigned char tmp;
+ size_t i, j;
PyObject* str = PyString_FromStringAndSize((const char*)data, height*stride);
- if (PyString_AsStringAndSize(str, &begin, &length)) {
+ if (PyString_AsStringAndSize(str, (char**)&begin, &length)) {
throw Py::TypeError("Could not create memory for blit");
}
pix = begin;
end = begin + (height * stride);
- while (pix != end) {
- // Convert rgba to argb
- tmp = pix[3];
- pix[3] = pix[2];
- pix[2] = pix[1];
- pix[1] = pix[0];
- pix[0] = pix[3];
- pix += 4;
+ for (i = 0; i < (size_t)height; ++i) {
+ pix = begin + i * stride;
+ for (j = 0; j < (size_t)width; ++j) {
+ // Convert rgba to argb
+ tmp = pix[2];
+ pix[2] = pix[0];
+ pix[0] = tmp;
+ pix += 4;
+ }
}
return Py::String(str, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-06 18:56:59
|
Revision: 5123
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5123&view=rev
Author: mdboom
Date: 2008-05-06 11:56:47 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Fixing bugs in recent changes to Qt blitting.
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
branches/v0_91_maint/src/_backend_agg.cpp
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 15:42:16 UTC (rev 5122)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 18:56:47 UTC (rev 5123)
@@ -109,8 +109,10 @@
# we are blitting here
else:
bbox = self.replot
- w, h = int(bbox.width()), int(bbox.height())
- l, t = bbox.ll().x().get(), bbox.ur().y().get()
+ l, t = int(bbox.ll().x().get()), int(bbox.ur().y().get())
+ r, b = int(bbox.ur().x().get()), int(bbox.ll().y().get())
+ w = r - l
+ h = t - b
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string_argb()
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 15:42:16 UTC (rev 5122)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 18:56:47 UTC (rev 5123)
@@ -115,8 +115,10 @@
# we are blitting here
else:
bbox = self.replot
- w, h = int(bbox.width()), int(bbox.height())
- l, t = bbox.ll().x().get(), bbox.ur().y().get()
+ l, t = int(bbox.ll().x().get()), int(bbox.ur().y().get())
+ r, b = int(bbox.ur().x().get()), int(bbox.ll().y().get())
+ w = r - l
+ h = t - b
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string_argb()
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian)
Modified: branches/v0_91_maint/src/_backend_agg.cpp
===================================================================
--- branches/v0_91_maint/src/_backend_agg.cpp 2008-05-06 15:42:16 UTC (rev 5122)
+++ branches/v0_91_maint/src/_backend_agg.cpp 2008-05-06 18:56:47 UTC (rev 5123)
@@ -227,26 +227,28 @@
Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) {
// owned=true to prevent memory leak
Py_ssize_t length;
- char* pix;
- char* begin;
- char* end;
- char tmp;
+ unsigned char* pix;
+ unsigned char* begin;
+ unsigned char* end;
+ unsigned char tmp;
+ size_t i, j;
PyObject* str = PyString_FromStringAndSize((const char*)aggbuf.data, aggbuf.height*aggbuf.stride);
- if (PyString_AsStringAndSize(str, &begin, &length)) {
+ if (PyString_AsStringAndSize(str, (char**)&begin, &length)) {
throw Py::TypeError("Could not create memory for blit");
}
pix = begin;
end = begin + (aggbuf.height * aggbuf.stride);
- while (pix != end) {
- // Convert rgba to argb
- tmp = pix[3];
- pix[3] = pix[2];
- pix[2] = pix[1];
- pix[1] = pix[0];
- pix[0] = pix[3];
- pix += 4;
+ for (i = 0; i < aggbuf.height; ++i) {
+ pix = begin + i * aggbuf.stride;
+ for (j = 0; j < aggbuf.width; ++j) {
+ // Convert rgba to argb
+ tmp = pix[2];
+ pix[2] = pix[0];
+ pix[0] = tmp;
+ pix += 4;
+ }
}
return Py::String(str, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-06 15:42:29
|
Revision: 5122
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5122&view=rev
Author: mdboom
Date: 2008-05-06 08:42:16 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Merged revisions 5109-5121 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_91_maint
........
r5119 | jdh2358 | 2008-05-06 10:34:32 -0400 (Tue, 06 May 2008) | 1 line
use pngs for wx icons
........
r5120 | mdboom | 2008-05-06 11:25:04 -0400 (Tue, 06 May 2008) | 2 lines
Fix blitting in Qt backends (which need ARGB, not RGBA)
........
r5121 | mdboom | 2008-05-06 11:30:09 -0400 (Tue, 06 May 2008) | 2 lines
Forgot CHANGELOG
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
trunk/matplotlib/src/_backend_agg.cpp
trunk/matplotlib/src/_backend_agg.h
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5108
+ /branches/v0_91_maint:1-5121
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-06 15:30:09 UTC (rev 5121)
+++ trunk/matplotlib/CHANGELOG 2008-05-06 15:42:16 UTC (rev 5122)
@@ -1,3 +1,5 @@
+2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
+
2008-05-05 pass notify_axes_change to the figure's add_axobserver
in the qt backends, like we do for the other backends.
Thanks Glenn Jones for the report - DSD
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 15:30:09 UTC (rev 5121)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 15:42:16 UTC (rev 5122)
@@ -114,7 +114,7 @@
h = int(t) - int(b)
t = int(b) + h
reg = self.copy_from_bbox(bbox)
- stringBuffer = reg.to_string()
+ stringBuffer = reg.to_string_argb()
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)
pixmap = QtGui.QPixmap.fromImage(qImage)
p = QtGui.QPainter( self )
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 15:30:09 UTC (rev 5121)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 15:42:16 UTC (rev 5122)
@@ -119,7 +119,7 @@
w = int(r) - int(l)
h = int(t) - int(b)
reg = self.copy_from_bbox(bbox)
- stringBuffer = reg.to_string()
+ stringBuffer = reg.to_string_argb()
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian)
self.pixmap.convertFromImage(qImage, qt.QPixmap.Color)
p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap)
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-05-06 15:30:09 UTC (rev 5121)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-05-06 15:42:16 UTC (rev 5122)
@@ -90,6 +90,34 @@
return Py::String(PyString_FromStringAndSize((const char*)data, height*stride), true);
}
+Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) {
+ // owned=true to prevent memory leak
+ Py_ssize_t length;
+ char* pix;
+ char* begin;
+ char* end;
+ char tmp;
+
+ PyObject* str = PyString_FromStringAndSize((const char*)data, height*stride);
+ if (PyString_AsStringAndSize(str, &begin, &length)) {
+ throw Py::TypeError("Could not create memory for blit");
+ }
+
+ pix = begin;
+ end = begin + (height * stride);
+ while (pix != end) {
+ // Convert rgba to argb
+ tmp = pix[3];
+ pix[3] = pix[2];
+ pix[2] = pix[1];
+ pix[1] = pix[0];
+ pix[0] = pix[3];
+ pix += 4;
+ }
+
+ return Py::String(str, true);
+}
+
GCAgg::GCAgg(const Py::Object &gc, double dpi) :
dpi(dpi), isaa(true), linewidth(1.0), alpha(1.0),
dashOffset(0.0)
@@ -210,7 +238,6 @@
}
}
-
const size_t
RendererAgg::PIXELS_PER_INCH(96);
@@ -1707,6 +1734,8 @@
add_varargs_method("to_string", &BufferRegion::to_string,
"to_string()");
+ add_varargs_method("to_string_argb", &BufferRegion::to_string_argb,
+ "to_string_argb()");
}
Modified: trunk/matplotlib/src/_backend_agg.h
===================================================================
--- trunk/matplotlib/src/_backend_agg.h 2008-05-06 15:30:09 UTC (rev 5121)
+++ trunk/matplotlib/src/_backend_agg.h 2008-05-06 15:42:16 UTC (rev 5122)
@@ -103,6 +103,7 @@
bool freemem;
Py::Object to_string(const Py::Tuple &args);
+ Py::Object to_string_argb(const Py::Tuple &args);
static void init_type(void);
virtual ~BufferRegion() {
@@ -138,7 +139,7 @@
double dashOffset;
dash_t dashes;
- protected:
+protected:
agg::rgba get_color(const Py::Object& gc);
double points_to_pixels( const Py::Object& points);
void _set_linecap(const Py::Object& gc) ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-06 15:30:29
|
Revision: 5121
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5121&view=rev
Author: mdboom
Date: 2008-05-06 08:30:09 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Forgot CHANGELOG
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-05-06 15:25:04 UTC (rev 5120)
+++ branches/v0_91_maint/CHANGELOG 2008-05-06 15:30:09 UTC (rev 5121)
@@ -1,3 +1,5 @@
+2008-05-06 Fix strange colors when blitting in QtAgg and Qt4Agg - MGD
+
2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying
Qt version. [1851364] - MGD
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-06 15:25:18
|
Revision: 5120
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5120&view=rev
Author: mdboom
Date: 2008-05-06 08:25:04 -0700 (Tue, 06 May 2008)
Log Message:
-----------
Fix blitting in Qt backends (which need ARGB, not RGBA)
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
branches/v0_91_maint/src/_backend_agg.cpp
branches/v0_91_maint/src/_backend_agg.h
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 14:34:32 UTC (rev 5119)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qt4agg.py 2008-05-06 15:25:04 UTC (rev 5120)
@@ -112,7 +112,7 @@
w, h = int(bbox.width()), int(bbox.height())
l, t = bbox.ll().x().get(), bbox.ur().y().get()
reg = self.copy_from_bbox(bbox)
- stringBuffer = reg.to_string()
+ stringBuffer = reg.to_string_argb()
qImage = QtGui.QImage(stringBuffer, w, h, QtGui.QImage.Format_ARGB32)
pixmap = QtGui.QPixmap.fromImage(qImage)
p = QtGui.QPainter( self )
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 14:34:32 UTC (rev 5119)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_qtagg.py 2008-05-06 15:25:04 UTC (rev 5120)
@@ -118,7 +118,7 @@
w, h = int(bbox.width()), int(bbox.height())
l, t = bbox.ll().x().get(), bbox.ur().y().get()
reg = self.copy_from_bbox(bbox)
- stringBuffer = reg.to_string()
+ stringBuffer = reg.to_string_argb()
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0, qt.QImage.IgnoreEndian)
self.pixmap.convertFromImage(qImage, qt.QPixmap.Color)
p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap)
Modified: branches/v0_91_maint/src/_backend_agg.cpp
===================================================================
--- branches/v0_91_maint/src/_backend_agg.cpp 2008-05-06 14:34:32 UTC (rev 5119)
+++ branches/v0_91_maint/src/_backend_agg.cpp 2008-05-06 15:25:04 UTC (rev 5120)
@@ -224,9 +224,35 @@
return Py::String(PyString_FromStringAndSize((const char*)aggbuf.data,aggbuf.height*aggbuf.stride), true);
}
+Py::Object BufferRegion::to_string_argb(const Py::Tuple &args) {
+ // owned=true to prevent memory leak
+ Py_ssize_t length;
+ char* pix;
+ char* begin;
+ char* end;
+ char tmp;
+ PyObject* str = PyString_FromStringAndSize((const char*)aggbuf.data, aggbuf.height*aggbuf.stride);
+ if (PyString_AsStringAndSize(str, &begin, &length)) {
+ throw Py::TypeError("Could not create memory for blit");
+ }
+ pix = begin;
+ end = begin + (aggbuf.height * aggbuf.stride);
+ while (pix != end) {
+ // Convert rgba to argb
+ tmp = pix[3];
+ pix[3] = pix[2];
+ pix[2] = pix[1];
+ pix[1] = pix[0];
+ pix[0] = pix[3];
+ pix += 4;
+ }
+ return Py::String(str, true);
+}
+
+
const size_t
RendererAgg::PIXELS_PER_INCH(96);
@@ -2612,7 +2638,8 @@
add_varargs_method("to_string", &BufferRegion::to_string,
"to_string()");
-
+ add_varargs_method("to_string_argb", &BufferRegion::to_string_argb,
+ "to_string_argb()");
}
Modified: branches/v0_91_maint/src/_backend_agg.h
===================================================================
--- branches/v0_91_maint/src/_backend_agg.h 2008-05-06 14:34:32 UTC (rev 5119)
+++ branches/v0_91_maint/src/_backend_agg.h 2008-05-06 15:25:04 UTC (rev 5120)
@@ -67,7 +67,7 @@
SafeSnap() : first(true), xsnap(0.0), lastx(0.0), lastxsnap(0.0),
ysnap(0.0), lasty(0.0), lastysnap(0.0) {}
SnapData snap (const float& x, const float& y);
-
+
private:
bool first;
float xsnap, lastx, lastxsnap, ysnap, lasty, lastysnap;
@@ -85,6 +85,7 @@
agg::rect rect;
bool freemem;
Py::Object to_string(const Py::Tuple &args);
+ Py::Object to_string_argb(const Py::Tuple &args);
static void init_type(void);
virtual ~BufferRegion() {
@@ -125,7 +126,7 @@
double dashOffset;
double *dasha;
-
+
protected:
agg::rgba get_color(const Py::Object& gc);
double points_to_pixels( const Py::Object& points);
@@ -141,7 +142,7 @@
//struct AMRenderer {
-//
+//
//}
// the renderer
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-06 14:34:40
|
Revision: 5119
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5119&view=rev
Author: jdh2358
Date: 2008-05-06 07:34:32 -0700 (Tue, 06 May 2008)
Log Message:
-----------
use pngs for wx icons
Modified Paths:
--------------
branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
Modified: branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py
===================================================================
--- branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-05-06 14:33:58 UTC (rev 5118)
+++ branches/v0_91_maint/lib/matplotlib/backends/backend_wx.py 2008-05-06 14:34:32 UTC (rev 5119)
@@ -1452,6 +1452,24 @@
bmp =wx.Bitmap(bmpFilename, wx.BITMAP_TYPE_XPM)
return bmp
+def _load_pngicon(filename):
+ """
+ Load a png icon file from the backends/images subdirectory in which the
+ matplotlib library is installed. The filename parameter should not
+ contain any path information as this is determined automatically.
+
+ Returns a wx.Bitmap object
+ """
+
+ basedir = os.path.join(rcParams['datapath'],'images')
+
+ pngFilename = os.path.normpath(os.path.join(basedir, filename))
+ if not os.path.exists(pngFilename):
+ raise IOError('Could not find bitmap file "%s"; dying'%pngFilename)
+
+ png =wx.Bitmap(pngFilename, wx.BITMAP_TYPE_PNG)
+ return png
+
class MenuButtonWx(wx.Button):
"""
wxPython does not permit a menu to be incorporated directly into a toolbar.
@@ -1612,24 +1630,24 @@
self.SetToolBitmapSize(wx.Size(24,24))
- self.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.xpm'),
+ self.AddSimpleTool(_NTB2_HOME, _load_pngicon('home.png'),
'Home', 'Reset original view')
- self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.xpm'),
+ self.AddSimpleTool(self._NTB2_BACK, _load_pngicon('back.png'),
'Back', 'Back navigation view')
- self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.xpm'),
+ self.AddSimpleTool(self._NTB2_FORWARD, _load_pngicon('forward.png'),
'Forward', 'Forward navigation view')
# todo: get new bitmap
- self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.xpm'),
+ self.AddCheckTool(self._NTB2_PAN, _load_pngicon('move.png'),
shortHelp='Pan',
longHelp='Pan with left, zoom with right')
- self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.xpm'),
+ self.AddCheckTool(self._NTB2_ZOOM, _load_pngicon('zoom_to_rect.png'),
shortHelp='Zoom', longHelp='Zoom to rectangle')
self.AddSeparator()
- self.AddSimpleTool(_NTB2_SUBPLOT, _load_bitmap('subplots.xpm'),
+ self.AddSimpleTool(_NTB2_SUBPLOT, _load_pngicon('subplots.png'),
'Configure subplots', 'Configure subplot parameters')
- self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.xpm'),
+ self.AddSimpleTool(_NTB2_SAVE, _load_pngicon('filesave.png'),
'Save', 'Save plot contents to file')
if wx.VERSION_STRING >= '2.5':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-05-06 14:34:21
|
Revision: 5118
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5118&view=rev
Author: jdh2358
Date: 2008-05-06 07:33:58 -0700 (Tue, 06 May 2008)
Log Message:
-----------
use pngs for wx icons
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-05-05 18:59:10 UTC (rev 5117)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-05-06 14:33:58 UTC (rev 5118)
@@ -6017,4 +6017,5 @@
maxx = max(posx)
# warning, probably breaks inverted axis
self.set_xlim((0.1*minx, maxx))
+
"""
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-05-05 18:59:10 UTC (rev 5117)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-05-06 14:33:58 UTC (rev 5118)
@@ -1392,6 +1392,24 @@
bmp =wx.Bitmap(bmpFilename, wx.BITMAP_TYPE_XPM)
return bmp
+def _load_pngicon(filename):
+ """
+ Load a png icon file from the backends/images subdirectory in which the
+ matplotlib library is installed. The filename parameter should not
+ contain any path information as this is determined automatically.
+
+ Returns a wx.Bitmap object
+ """
+
+ basedir = os.path.join(rcParams['datapath'],'images')
+
+ pngFilename = os.path.normpath(os.path.join(basedir, filename))
+ if not os.path.exists(pngFilename):
+ raise IOError('Could not find bitmap file "%s"; dying'%pngFilename)
+
+ png =wx.Bitmap(pngFilename, wx.BITMAP_TYPE_PNG)
+ return png
+
class MenuButtonWx(wx.Button):
"""
wxPython does not permit a menu to be incorporated directly into a toolbar.
@@ -1552,24 +1570,24 @@
self.SetToolBitmapSize(wx.Size(24,24))
- self.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.xpm'),
+ self.AddSimpleTool(_NTB2_HOME, _load_pngicon('home.png'),
'Home', 'Reset original view')
- self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.xpm'),
+ self.AddSimpleTool(self._NTB2_BACK, _load_pngicon('back.png'),
'Back', 'Back navigation view')
- self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.xpm'),
+ self.AddSimpleTool(self._NTB2_FORWARD, _load_pngicon('forward.png'),
'Forward', 'Forward navigation view')
# todo: get new bitmap
- self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.xpm'),
+ self.AddCheckTool(self._NTB2_PAN, _load_pngicon('move.png'),
shortHelp='Pan',
longHelp='Pan with left, zoom with right')
- self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.xpm'),
+ self.AddCheckTool(self._NTB2_ZOOM, _load_pngicon('zoom_to_rect.png'),
shortHelp='Zoom', longHelp='Zoom to rectangle')
self.AddSeparator()
- self.AddSimpleTool(_NTB2_SUBPLOT, _load_bitmap('subplots.xpm'),
+ self.AddSimpleTool(_NTB2_SUBPLOT, _load_pngicon('subplots.png'),
'Configure subplots', 'Configure subplot parameters')
- self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.xpm'),
+ self.AddSimpleTool(_NTB2_SAVE, _load_pngicon('filesave.png'),
'Save', 'Save plot contents to file')
if wx.VERSION_STRING >= '2.5':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-05-05 18:59:42
|
Revision: 5117
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5117&view=rev
Author: dsdale
Date: 2008-05-05 11:59:10 -0700 (Mon, 05 May 2008)
Log Message:
-----------
forgot to make a note in the changelog
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-05-05 18:56:38 UTC (rev 5116)
+++ trunk/matplotlib/CHANGELOG 2008-05-05 18:59:10 UTC (rev 5117)
@@ -1,3 +1,7 @@
+2008-05-05 pass notify_axes_change to the figure's add_axobserver
+ in the qt backends, like we do for the other backends.
+ Thanks Glenn Jones for the report - DSD
+
2008-05-02 Added step histograms, based on patch by Erik Tollerud. - MM
2008-05-02 On PyQt <= 3.14 there is no way to determine the underlying
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-05-05 18:56:41
|
Revision: 5116
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5116&view=rev
Author: dsdale
Date: 2008-05-05 11:56:38 -0700 (Mon, 05 May 2008)
Log Message:
-----------
fixed a bug where notify_axes_change was not connected
passed to figure.add_axobserver in qt backends
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-05-05 18:54:59 UTC (rev 5115)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-05-05 18:56:38 UTC (rev 5116)
@@ -238,7 +238,7 @@
def notify_axes_change( fig ):
# This will be called whenever the current axes is changed
if self.toolbar != None: self.toolbar.update()
- self.canvas.figure.add_axobserver( notify_axes_change )
+ self.canvas.figure.add_axobserver( notify_axes_change )
def _widgetclosed( self ):
if self.window._destroying: return
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-05-05 18:54:59 UTC (rev 5115)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-05-05 18:56:38 UTC (rev 5116)
@@ -221,7 +221,7 @@
def notify_axes_change( fig ):
# This will be called whenever the current axes is changed
if self.toolbar != None: self.toolbar.update()
- self.canvas.figure.add_axobserver( notify_axes_change )
+ self.canvas.figure.add_axobserver( notify_axes_change )
def _widgetclosed( self ):
if self.window._destroying: return
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-05-05 18:55:30
|
Revision: 5115
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5115&view=rev
Author: dsdale
Date: 2008-05-05 11:54:59 -0700 (Mon, 05 May 2008)
Log Message:
-----------
minor fix to embedding_in_qt4 demo
Modified Paths:
--------------
trunk/matplotlib/examples/embedding_in_qt4.py
Modified: trunk/matplotlib/examples/embedding_in_qt4.py
===================================================================
--- trunk/matplotlib/examples/embedding_in_qt4.py 2008-05-05 17:06:08 UTC (rev 5114)
+++ trunk/matplotlib/examples/embedding_in_qt4.py 2008-05-05 18:54:59 UTC (rev 5115)
@@ -23,14 +23,15 @@
class MyMplCanvas(FigureCanvas):
"""Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
def __init__(self, parent=None, width=5, height=4, dpi=100):
- self.fig = Figure(figsize=(width, height), dpi=dpi)
- self.axes = self.fig.add_subplot(111)
+ fig = Figure(figsize=(width, height), dpi=dpi)
+ self.axes = fig.add_subplot(111)
# We want the axes cleared every time plot() is called
self.axes.hold(False)
self.compute_initial_figure()
- FigureCanvas.__init__(self, self.fig)
+ #
+ FigureCanvas.__init__(self, fig)
self.setParent(parent)
FigureCanvas.setSizePolicy(self,
@@ -38,14 +39,10 @@
QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)
- def sizeHint(self):
- w, h = self.get_width_height()
- return QtCore.QSize(w, h)
+ def compute_initial_figure(self):
+ pass
- def minimumSizeHint(self):
- return QtCore.QSize(10, 10)
-
class MyStaticMplCanvas(MyMplCanvas):
"""Simple canvas with a sine plot."""
def compute_initial_figure(self):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-05 17:06:12
|
Revision: 5114
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5114&view=rev
Author: jswhit
Date: 2008-05-05 10:06:08 -0700 (Mon, 05 May 2008)
Log Message:
-----------
update for new setup.cfg
Modified Paths:
--------------
trunk/toolkits/basemap/README
Modified: trunk/toolkits/basemap/README
===================================================================
--- trunk/toolkits/basemap/README 2008-05-05 17:01:24 UTC (rev 5113)
+++ trunk/toolkits/basemap/README 2008-05-05 17:06:08 UTC (rev 5114)
@@ -92,8 +92,17 @@
> make; make install
3) cd back to the top level basemap directory (basemap-X.Y.Z) and
-run the usual 'python setup.py install'.
+run the usual 'python setup.py install'. Check your installation
+by running "from mpl_toolkits.basemap import Basemap" at the python
+prompt.
+Basemap includes two auxilliary packages, pydap (http://pydap.org, just
+the client is included) and httplib2. By default, setup.py checks to
+see if these are already installed, and if so does not try to overwrite
+them. If you get import errors related to either of these two packages,
+edit setup.cfg and set pydap and/or httplib to True to force
+installation of the included versions.
+
4) To test, cd to the examples directory and run 'python simpletest.py'.
To run all the examples (except those that have extra dependencies
or require an internet connection), execute 'python run_all.py'.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-05-05 17:01:27
|
Revision: 5113
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5113&view=rev
Author: jswhit
Date: 2008-05-05 10:01:24 -0700 (Mon, 05 May 2008)
Log Message:
-----------
allow controlling package installation with setup.cfg
Modified Paths:
--------------
trunk/toolkits/basemap/MANIFEST.in
trunk/toolkits/basemap/setup.py
Added Paths:
-----------
trunk/toolkits/basemap/setup.cfg
Modified: trunk/toolkits/basemap/MANIFEST.in
===================================================================
--- trunk/toolkits/basemap/MANIFEST.in 2008-05-05 15:13:23 UTC (rev 5112)
+++ trunk/toolkits/basemap/MANIFEST.in 2008-05-05 17:01:24 UTC (rev 5113)
@@ -8,6 +8,7 @@
include KNOWN_BUGS
include Changelog
include setup.py
+include setup.cfg
include setupegg.py
include src/*
include examples/simpletest.py
Added: trunk/toolkits/basemap/setup.cfg
===================================================================
--- trunk/toolkits/basemap/setup.cfg (rev 0)
+++ trunk/toolkits/basemap/setup.cfg 2008-05-05 17:01:24 UTC (rev 5113)
@@ -0,0 +1,10 @@
+[provide_packages]
+# By default, basemap checks for a few dependencies and
+# installs them if missing. This feature can be turned off
+# by uncommenting the following lines. Acceptible values are:
+# True: install, overwrite an existing installation
+# False: do not install
+# auto: install only if the package is unavailable. This
+# is the default behavior
+pydap = auto
+httplib2 = auto
Modified: trunk/toolkits/basemap/setup.py
===================================================================
--- trunk/toolkits/basemap/setup.py 2008-05-05 15:13:23 UTC (rev 5112)
+++ trunk/toolkits/basemap/setup.py 2008-05-05 17:01:24 UTC (rev 5113)
@@ -1,3 +1,5 @@
+# basemap build options can be modified with the setup.cfg file. See
+# setup.cfg for more information.
import sys, glob, os, numpy
major, minor1, minor2, s, tmp = sys.version_info
if major==2 and minor1<=3:
@@ -114,27 +116,68 @@
include_dirs = ["pyshapelib/shapelib"],
define_macros = dbf_macros()) ]
-# install dap and httplib2, if not already available.
-# only a subset of dap is installed (the client, not the server)
-__dapversion__ = None
-try:
- from dap.lib import __version__ as __dapversion__
-except ImportError:
+# check setup.cfg file to see how to install auxilliary packages.
+options = {}
+if os.path.exists("setup.cfg"):
+ import ConfigParser
+ config = ConfigParser.SafeConfigParser()
+ config.read("setup.cfg")
+ try: options['provide_pydap'] = config.getboolean("provide_packages", "pydap")
+ except: options['provide_pydap'] = 'auto'
+ try: options['provide_httplib2'] = config.getboolean("provide_packages", "httplib2")
+ except: options['provide_httplib2'] = 'auto'
+else:
+ options['provide_pydap'] = 'auto'
+ options['provide_httplib2'] = 'auto'
+
+provide_pydap = options['provide_pydap']
+if provide_pydap == 'auto': # install pydap stuff if not already available.
+ # only the client is installed (not the server).
+ __dapversion__ = None
+ print 'checking to see if required version of pydap installed ..'
+ try:
+ from dap.lib import __version__ as __dapversion__
+ except ImportError:
+ print 'pydap not installed, client will be installed'
+ packages = packages + ['dap','dap.util','dap.parsers']
+ package_dirs['dap'] = os.path.join('lib','dap')
+ else:
+ print 'pydap installed, checking version ...'
+ # install dap client anyway if installed version is older than
+ # version provided here.
+ if __dapversion__ is not None:
+ __dapversion__ = [repr(v)+'.' for v in __dapversion__]
+ __dapversion__ = ''.join(__dapversion__)[:-1]
+ if __dapversion__ < '2.2.6.2':
+ print 'required version of pydap not installed, client will be installed'
+ packages = packages + ['dap','dap.util','dap.parsers']
+ package_dirs['dap'] = os.path.join('lib','dap')
+ else:
+ print 'pydap version OK, will not be installed'
+elif provide_pydap: # force install of pydap stuff.
+ print 'forcing install of included pydap client'
packages = packages + ['dap','dap.util','dap.parsers']
package_dirs['dap'] = os.path.join('lib','dap')
-# install dap client anyway if installed version is older than
-# version provided here.
-if __dapversion__ is not None:
- __dapversion__ = [repr(v)+'.' for v in __dapversion__]
- __dapversion__ = ''.join(__dapversion__)[:-1]
- if __dapversion__ < '2.2.6.2':
- packages = packages + ['dap','dap.util','dap.parsers']
- package_dirs['dap'] = os.path.join('lib','dap')
-try:
- import httplib2
-except ImportError:
+else:
+ print 'will not install pydap'
+
+provide_httplib2 = options['provide_httplib2']
+if provide_httplib2 == 'auto':
+ print 'checking to see if httplib2 installed ..'
+ try:
+ import httplib2
+ except ImportError:
+ print 'httplib2 not installed, will be installed'
+ packages = packages + ['httplib2']
+ package_dirs['httlib2'] = os.path.join('lib','httplib2')
+ else:
+ print 'httplib2 installed'
+elif provide_httplib2: # force install of httplib2
+ print 'forcing install of included httplib2'
packages = packages + ['httplib2']
package_dirs['httlib2'] = os.path.join('lib','httplib2')
+else:
+ print 'will not install httplib2'
# Specify all the required mpl data
pyproj_datafiles = ['data/epsg', 'data/esri', 'data/esri.extra', 'data/GL27', 'data/nad.lst', 'data/nad27', 'data/nad83', 'data/ntv2_out.dist', 'data/other.extra', 'data/pj_out27.dist', 'data/pj_out83.dist', 'data/proj_def.dat', 'data/README', 'data/td_out.dist', 'data/test27', 'data/test83', 'data/testntv2', 'data/testvarious', 'data/world','data/bmng.jpg']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-05-05 15:13:29
|
Revision: 5112
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5112&view=rev
Author: mdboom
Date: 2008-05-05 08:13:23 -0700 (Mon, 05 May 2008)
Log Message:
-----------
Allow "start_rasterizing"/"stop_rasterizing" to be nested.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2008-05-05 15:12:29 UTC (rev 5111)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_mixed.py 2008-05-05 15:13:23 UTC (rev 5112)
@@ -36,7 +36,7 @@
self._vector_renderer = vector_renderer
self._raster_renderer = None
- self._rasterizing = False
+ self._rasterizing = 0
self._set_current_renderer(vector_renderer)
@@ -65,11 +65,11 @@
If start_rasterizing is called multiple times before
stop_rasterizing is called, this method has no effect.
"""
- if not self._rasterizing:
+ if self._rasterizing == 0:
self._raster_renderer = self._raster_renderer_class(
self._width*self.dpi, self._height*self.dpi, self.dpi)
self._set_current_renderer(self._raster_renderer)
- self._rasterizing = True
+ self._rasterizing += 1
def stop_rasterizing(self):
"""
@@ -80,7 +80,8 @@
If stop_rasterizing is called multiple times before
start_rasterizing is called, this method has no effect.
"""
- if self._rasterizing:
+ self._rasterizing -= 1
+ if self._rasterizing == 0:
self._set_current_renderer(self._vector_renderer)
width, height = self._width * self.dpi, self._height * self.dpi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|