SF.net SVN: matplotlib:[6941] branches/v0_98_5_maint/src/ft2font.cpp
Revision: 6941
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6941&view=rev
Author: mdboom
Date: 2009-02-27 13:30:13 + (Fri, 27 Feb 2009)
Log Message:
---
Fix glyph alignment with STIX mathtext
Modified Paths:
--
branches/v0_98_5_maint/src/ft2font.cpp
Modified: branches/v0_98_5_maint/src/ft2font.cpp
===
--- branches/v0_98_5_maint/src/ft2font.cpp 2009-02-26 20:20:47 UTC (rev
6940)
+++ branches/v0_98_5_maint/src/ft2font.cpp 2009-02-27 13:30:13 UTC (rev
6941)
@@ -1256,8 +1256,14 @@
throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)");
FT2Image* im = static_cast(args[0].ptr());
- long x = Py::Int(args[1]);
- long y = Py::Int(args[2]);
+ double xd = Py::Float(args[1]);
+ double yd = Py::Float(args[2]);
+ long x = (long)mpl_round(xd);
+ long y = (long)mpl_round(yd);
+ FT_Vector sub_offset;
+ sub_offset.x = int((xd - (double)x) * 64.0);
+ sub_offset.y = int((yd - (double)y) * 64.0);
+
if (!Glyph::check(args[3].ptr()))
throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)");
Glyph* glyph = static_cast(args[3].ptr());
@@ -1267,7 +1273,7 @@
error = FT_Glyph_To_Bitmap(&glyphs[glyph->glyphInd],
ft_render_mode_normal,
-0, //no additional translation
+&sub_offset, //no additional translation
1 //destroy image;
);
if (error)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6942] trunk/matplotlib
Revision: 6942
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6942&view=rev
Author: mdboom
Date: 2009-02-27 13:32:10 + (Fri, 27 Feb 2009)
Log Message:
---
Merged revisions 6941 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint
r6941 | mdboom | 2009-02-27 08:30:13 -0500 (Fri, 27 Feb 2009) | 2 lines
Fix glyph alignment with STIX mathtext
Modified Paths:
--
trunk/matplotlib/src/ft2font.cpp
Property Changed:
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6938
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6941
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941
Property changes on: trunk/matplotlib/doc/pyplots/README
___
Modified: svn:mergeinfo
-
/branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934
+
/branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941
Modified: trunk/matplotlib/src/ft2font.cpp
===
--- trunk/matplotlib/src/ft2font.cpp2009-02-27 13:30:13 UTC (rev 6941)
+++ trunk/matplotlib/src/ft2font.cpp2009-02-27 13:32:10 UTC (rev 6942)
@@ -1255,8 +1255,14 @@
throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)");
FT2Image* im = static_cast(args[0].ptr());
- long x = Py::Int(args[1]);
- long y = Py::Int(args[2]);
+ double xd = Py::Float(args[1]);
+ d
SF.net SVN: matplotlib:[6943] trunk/matplotlib/lib/matplotlib/ _pylab_helpers.py
Revision: 6943
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6943&view=rev
Author: efiring
Date: 2009-02-28 07:46:14 + (Sat, 28 Feb 2009)
Log Message:
---
Add documentation, style updates to _pylab_helpers.py
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/_pylab_helpers.py
Modified: trunk/matplotlib/lib/matplotlib/_pylab_helpers.py
===
--- trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2009-02-27 13:32:10 UTC
(rev 6942)
+++ trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2009-02-28 07:46:14 UTC
(rev 6943)
@@ -1,3 +1,7 @@
+"""
+Manage figures for pyplot interface.
+"""
+
import sys, gc
def error_msg(msg):
@@ -4,56 +8,100 @@
print >>sys.stderr, msgs
class Gcf(object):
+"""
+Manage a set of integer-numbered figures.
+
+This class is never instantiated; it consists of two class
+attributes (a list and a dictionary), and a set of static
+methods that operate on those attributes, accessing them
+directly as class attributes.
+
+Attributes:
+
+*figs*:
+ dictionary of the form {*num*: *manager*, ...}
+
+*_activeQue*:
+ list of *managers*, with active one at the end
+
+"""
_activeQue = []
figs = {}
+@staticmethod
def get_fig_manager(num):
+"""
+If figure manager *num* exists, make it the active
+figure and return the manager; otherwise return *None*.
+"""
figManager = Gcf.figs.get(num, None)
-if figManager is not None: Gcf.set_active(figManager)
+if figManager is not None:
+Gcf.set_active(figManager)
return figManager
-get_fig_manager = staticmethod(get_fig_manager)
+@staticmethod
def destroy(num):
+"""
+Try to remove all traces of figure *num*.
+In the interactive backends, this is bound to the
+window "destroy" and "delete" events.
+"""
if not Gcf.has_fignum(num): return
figManager = Gcf.figs[num]
+# There must be a good reason for the following careful
+# rebuilding of the activeQue; what is it?
oldQue = Gcf._activeQue[:]
Gcf._activeQue = []
for f in oldQue:
-if f != figManager: Gcf._activeQue.append(f)
+if f != figManager:
+Gcf._activeQue.append(f)
del Gcf.figs[num]
#print len(Gcf.figs.keys()), len(Gcf._activeQue)
figManager.destroy()
gc.collect()
-destroy = staticmethod(destroy)
-
+@staticmethod
def has_fignum(num):
+"""
+Return *True* if figure *num* exists.
+"""
return num in Gcf.figs
-has_fignum = staticmethod(has_fignum)
+@staticmethod
def get_all_fig_managers():
+"""
+Return a list of figure managers.
+"""
return Gcf.figs.values()
-get_all_fig_managers = staticmethod(get_all_fig_managers)
+@staticmethod
def get_num_fig_managers():
+"""
+Return the number of figures being managed.
+"""
return len(Gcf.figs.values())
-get_num_fig_managers = staticmethod(get_num_fig_managers)
-
+@staticmethod
def get_active():
+"""
+Return the manager of the active figure, or *None*.
+"""
if len(Gcf._activeQue)==0:
return None
else: return Gcf._activeQue[-1]
-get_active = staticmethod(get_active)
+@staticmethod
def set_active(manager):
+"""
+Make the figure corresponding to *manager* the active one.
+"""
oldQue = Gcf._activeQue[:]
Gcf._activeQue = []
for m in oldQue:
if m != manager: Gcf._activeQue.append(m)
Gcf._activeQue.append(manager)
Gcf.figs[manager.num] = manager
-set_active = staticmethod(set_active)
+
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
