From: <md...@us...> - 2009-05-01 18:05:14
|
Revision: 7076 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7076&view=rev Author: mdboom Date: 2009-05-01 18:05:12 +0000 (Fri, 01 May 2009) Log Message: ----------- Scale fonts correctly for Mac OS-X backend. (Patch contributed by Michiel de Hoon). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-04-30 17:31:23 UTC (rev 7075) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-05-01 18:05:12 UTC (rev 7076) @@ -107,7 +107,6 @@ n = self.gc.level() - gc.level() for i in range(n): self.gc.restore() self.gc = gc - size = prop.get_size_in_points() ox, oy, width, height, descent, image, used_characters = \ self.mathtext_parser.parse(s, self.dpi, prop) gc.draw_mathtext(x, y, angle, 255 - image.as_array()) @@ -121,15 +120,15 @@ self._draw_mathtext(gc, x, y, s, prop, angle) else: family = prop.get_family() - size = prop.get_size_in_points() weight = prop.get_weight() style = prop.get_style() + points = prop.get_size_in_points() + size = self.points_to_pixels(points) gc.draw_text(x, y, unicode(s), family, size, weight, style, angle) def get_text_width_height_descent(self, s, prop, ismath): if ismath=='TeX': # todo: handle props - size = prop.get_size_in_points() texmanager = self.get_texmanager() fontsize = prop.get_size_in_points() w, h, d = texmanager.get_text_width_height_descent(s, fontsize, @@ -140,9 +139,10 @@ self.mathtext_parser.parse(s, self.dpi, prop) return width, height, descent family = prop.get_family() - size = prop.get_size_in_points() weight = prop.get_weight() style = prop.get_style() + points = prop.get_size_in_points() + size = self.points_to_pixels(points) width, height, descent = self.gc.get_text_width_height_descent(unicode(s), family, size, weight, style) return width, height, 0.0*descent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-02 02:22:22
|
Revision: 8365 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8365&view=rev Author: mdehoon Date: 2010-06-02 02:22:16 +0000 (Wed, 02 Jun 2010) Log Message: ----------- Check if Python is installed as a framework, and print a warning otherwise. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-01 19:06:28 UTC (rev 8364) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-02 02:22:16 UTC (rev 8365) @@ -2,6 +2,7 @@ import os import numpy +import MacOS from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ @@ -222,6 +223,9 @@ """ Create a new figure manager instance """ + if not MacOS.WMAvailable(): + import warnings + warnings.warn("Python is not installed as a framework. The MacOSX backend may not work correctly if Python is not installed as a framework. Please see the Python documentation for more information on installing Python as a framework on Mac OS X") FigureClass = kwargs.pop('FigureClass', Figure) figure = FigureClass(*args, **kwargs) canvas = FigureCanvasMac(figure) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-08 22:41:17
|
Revision: 8398 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8398&view=rev Author: efiring Date: 2010-06-08 22:41:10 +0000 (Tue, 08 Jun 2010) Log Message: ----------- [3013440] add set_alpha method to GraphicsContextMac Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-08 21:57:14 UTC (rev 8397) +++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2010-06-08 22:41:10 UTC (rev 8398) @@ -180,6 +180,11 @@ GraphicsContextBase.__init__(self) _macosx.GraphicsContext.__init__(self) + def set_alpha(self, alpha): + GraphicsContextBase.set_alpha(self, alpha) + _alpha = self.get_alpha() + _macosx.GraphicsContext.set_alpha(self, _alpha) + def set_foreground(self, fg, isRGB=False): GraphicsContextBase.set_foreground(self, fg, isRGB) rgb = self.get_rgb() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |