Revision: 7838
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7838&view=rev
Author: mdboom
Date: 2009-10-01 12:57:39 +0000 (Thu, 01 Oct 2009)
Log Message:
-----------
Handle trailing whitespace in text.
Modified Paths:
--------------
trunk/matplotlib/src/ft2font.cpp
Modified: trunk/matplotlib/src/ft2font.cpp
===================================================================
--- trunk/matplotlib/src/ft2font.cpp 2009-10-01 12:37:49 UTC (rev 7837)
+++ trunk/matplotlib/src/ft2font.cpp 2009-10-01 12:57:39 UTC (rev 7838)
@@ -894,6 +894,7 @@
bbox.xMin = bbox.yMin = 32000;
bbox.xMax = bbox.yMax = -32000;
+ int right_side = 0;
for ( size_t n = 0; n < glyphs.size(); n++ ) {
FT_BBox glyph_bbox;
FT_Glyph_Get_CBox( glyphs[n], ft_glyph_bbox_subpixels, &glyph_bbox );
@@ -901,6 +902,8 @@
if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin;
if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax;
if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax;
+ right_side += glyphs[n]->advance.x >> 10;
+ if ( right_side > bbox.xMax ) bbox.xMax = right_side;
}
/* check that we really grew the string bbox */
if ( bbox.xMin > bbox.xMax ) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins