From: <md...@us...> - 2009-03-04 20:53:34
|
Revision: 6955 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6955&view=rev Author: mdboom Date: 2009-03-04 20:53:29 +0000 (Wed, 04 Mar 2009) Log Message: ----------- Fix wiggly baseline problem (again -- should have truncated rather than rounded) Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2009-03-04 18:16:50 UTC (rev 6954) +++ trunk/matplotlib/src/ft2font.cpp 2009-03-04 20:53:29 UTC (rev 6955) @@ -1257,8 +1257,8 @@ double xd = Py::Float(args[1]); double yd = Py::Float(args[2]); - long x = (long)mpl_round(xd); - long y = (long)mpl_round(yd); + long x = (long)xd; + long y = (long)yd; FT_Vector sub_offset; sub_offset.x = int((xd - (double)x) * 64.0); sub_offset.y = int((yd - (double)y) * 64.0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2009-10-01 14:08:06
|
Revision: 7839 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7839&view=rev Author: mdboom Date: 2009-10-01 14:07:59 +0000 (Thu, 01 Oct 2009) Log Message: ----------- Fix bug in last commit that caused unit test to fail. Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2009-10-01 12:57:39 UTC (rev 7838) +++ trunk/matplotlib/src/ft2font.cpp 2009-10-01 14:07:59 UTC (rev 7839) @@ -898,12 +898,15 @@ 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 ); - if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin; - 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; + if (glyph_bbox.xMin == glyph_bbox.xMax) { + right_side += glyphs[n]->advance.x >> 10; + if ( right_side > bbox.xMax ) bbox.xMax = right_side; + } else { + if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin; + 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; + } } /* 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. |
From: <md...@us...> - 2009-10-01 20:40:16
|
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. |
From: <md...@us...> - 2010-04-16 13:20:25
|
Revision: 8233 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8233&view=rev Author: mdboom Date: 2010-04-16 13:20:19 +0000 (Fri, 16 Apr 2010) Log Message: ----------- Eliminate wiggly baseline compensation. Seems to work without it now -- have no idea why it was needed before. Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2010-04-15 07:30:44 UTC (rev 8232) +++ trunk/matplotlib/src/ft2font.cpp 2010-04-16 13:20:19 UTC (rev 8233) @@ -1329,8 +1329,8 @@ long x = (long)xd; long y = (long)yd; FT_Vector sub_offset; - sub_offset.x = int(-(xd - (double)x) * 64.0); - sub_offset.y = int(-(yd - (double)y) * 64.0); + sub_offset.x = 0; // int((xd - (double)x) * 64.0); + sub_offset.y = 0; // int((yd - (double)y) * 64.0); if (!Glyph::check(args[3].ptr())) throw Py::TypeError("Usage: draw_glyph_to_bitmap(bitmap, x,y,glyph)"); @@ -1853,7 +1853,7 @@ add_keyword_method("load_char", &FT2Font::load_char, FT2Font::load_char__doc__); add_keyword_method("load_glyph", &FT2Font::load_glyph, - FT2Font::load_glyph__doc__); + FT2Font::load_glyph__doc__); add_keyword_method("set_text", &FT2Font::set_text, FT2Font::set_text__doc__); add_varargs_method("set_size", &FT2Font::set_size, @@ -1861,7 +1861,7 @@ add_varargs_method("set_charmap", &FT2Font::set_charmap, FT2Font::set_charmap__doc__); add_varargs_method("select_charmap", &FT2Font::select_charmap, - FT2Font::select_charmap__doc__); + FT2Font::select_charmap__doc__); add_varargs_method("get_width_height", &FT2Font::get_width_height, FT2Font::get_width_height__doc__); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-04 12:49:00
|
Revision: 8373 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8373&view=rev Author: mdboom Date: 2010-06-04 12:48:54 +0000 (Fri, 04 Jun 2010) Log Message: ----------- [3010045] leading whitespace removed from text Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2010-06-04 03:37:56 UTC (rev 8372) +++ trunk/matplotlib/src/ft2font.cpp 2010-06-04 12:48:54 UTC (rev 8373) @@ -916,15 +916,15 @@ 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 ); + if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin; + if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin; if (glyph_bbox.xMin == glyph_bbox.xMax) { right_side += glyphs[n]->advance.x >> 10; if ( right_side > bbox.xMax ) bbox.xMax = right_side; } else { - if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin; - 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; } + if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax; } /* 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. |
From: <md...@us...> - 2010-06-10 13:48:41
|
Revision: 8405 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8405&view=rev Author: mdboom Date: 2010-06-10 13:48:31 +0000 (Thu, 10 Jun 2010) Log Message: ----------- [3011582] stix_fonts_demo.py assert error When matplotlib is compiled without -DNDEBUG, we get this error on one of the example: $ python stix_fonts_demo.py python2.6: CXX/cxx_extensions.cxx:1320: virtual Py::PythonExtensionBase::~PythonExtensionBase(): Assertion `ob_refcnt == 0' failed. Aborted Modified Paths: -------------- trunk/matplotlib/src/ft2font.cpp Modified: trunk/matplotlib/src/ft2font.cpp =================================================================== --- trunk/matplotlib/src/ft2font.cpp 2010-06-10 01:59:13 UTC (rev 8404) +++ trunk/matplotlib/src/ft2font.cpp 2010-06-10 13:48:31 UTC (rev 8405) @@ -686,25 +686,28 @@ int error = FT_New_Face( _ft2Library, facefile.c_str(), 0, &face ); - if (error == FT_Err_Unknown_File_Format ) { std::ostringstream s; s << "Could not load facefile " << facefile << "; Unknown_File_Format" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error == FT_Err_Cannot_Open_Resource) { std::ostringstream s; s << "Could not open facefile " << facefile << "; Cannot_Open_Resource" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error == FT_Err_Invalid_File_Format) { std::ostringstream s; s << "Could not open facefile " << facefile << "; Invalid_File_Format" << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } else if (error) { std::ostringstream s; s << "Could not open facefile " << facefile << "; freetype error code " << error<< std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } @@ -720,6 +723,7 @@ if (error) { std::ostringstream s; s << "Could not set the fontsize for facefile " << facefile << std::endl; + ob_refcnt--; throw Py::RuntimeError(s.str()); } @@ -739,7 +743,6 @@ if ( style_name == NULL ) style_name = "UNAVAILABLE"; - setattr("postscript_name", Py::String(ps_name)); setattr("num_faces", Py::Int(face->num_faces)); setattr("family_name", Py::String(family_name)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |