[matplotlib-devel] mathtext2 implementation
Hi all, I just wanted to get others some insight about what I did in mathtext2. Who knows - it might turn out to be useful to someone ;) Also, any comments/thoughts are appreciated. A TeX math expression: $\sum_{i = 0}^{\infty}$ gets translated to a pure Python list, consisting of Python builtins: [u'\\sum', u'_', [u'i', u' ', u'=', u' ', u'0'], u'^', [u'\\infty']] This gets fed to a token parser that produces the TeX equivalent of hboxes. Every unicode character (including "\sum" - u'\u2211') gets translated to a TexCharClass instance. TexCharClass (I'm not very good at naming things :) is a class that completely handles rendering of a single character. It does this based on the information available from the font file (TrueType). More about fonts can be found in the excellent FreeType lib docs. http://www.freetype.org/freetype2/documentation.html A combination like a_b^c (or a^c_b) gets translated to a Scripted instance, which, again, handles the rendering of the sub/supercript and the nucleus. Similar for a fraction: a Fraction instance has a numerator and denumerator, which are used for rendering. The above python list [u'\\sum', u'_', [u'i', u' ', u'=', u' ', u'0'], u'^', [u'\\infty']] and any other sublist, like [u'i', u' ', u'=', u' ', u'0'] get translated to a Hbox instance. TexCharClass, Scripted, Fraction, Hbox (but also Line, Kern) are all sublclasses of Renderer, a class that defines an __init__ method and a render method. The data attributes of a Renderer instance (initialized to 0 by the Renderer's __init__ method) are xmin, xmax, ymin, ymax, bearingx, bearingy, width, height - for now. Basically, these are taken from the FreeType implementation of glyphs. In other words, every instance of Renderer, that is: an instance of a subclass of Renderer (Renderer is a virtual class) behaves like a glyph. http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html Unfortunately, although FreeType allows drawing of vertical text, I haven't implemented it yet. This would be also a base for Vbox, so, for example, \frac 1 2 could be translated to Vbox([u'1', Line(width, height), u'2']). Supporting vertical text involves adding additional attributes to the classes like, vertical bearingx, vertical bearingy (see the FreeType docs). Cheers, Edin - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] A C++ (ft2font.cpp) question
Hi all, I implemented the following method in ft2font.cpp, and although it works I don't know if it does the *right thing*. char FT2Font::draw_rect_filled__doc__[] = "draw_rect_filled(x0, y0, x1, y1)\n" "\n" "Draw a filled rect to the image. It is your responsibility to set the\n" "dimensions of the image, eg, with set_bitmap_size\n" "\n" ; Py::Object FT2Font::draw_rect_filled(const Py::Tuple & args) { _VERBOSE("FT2Font::draw_rect_filled"); args.verify_length(4); long x0 = Py::Int(args[0]); long y0 = Py::Int(args[1]); long x1 = Py::Int(args[2]); long y1 = Py::Int(args[3]); FT_Int iwidth = (FT_Int)image.width; FT_Int iheight = (FT_Int)image.height; if ( x0<0 || y0<0 || x1<0 || y1<0 || x0>iwidth || x1>iwidth || y0>iheight || y1>iheight ) throw Py::ValueError("Rect coords outside image bounds"); for (long j=y0; jhttp://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] Fwd: [Numpy-discussion] Going to cut NumPy 1.0b5 tonight
With matplotlib 0.87.5 shortly after. -- Forwarded message -- From: Travis Oliphant <[EMAIL PROTECTED]> Date: Sep 4, 2006 7:55 PM Subject: [Numpy-discussion] Going to cut NumPy 1.0b5 tonight To: Discussion of Numerical Python This is a last reminder that I'm going to cut a release of NumPy 1.0b5 tonight. Please have any fixes and/or problems worked out before then. -Travis - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Fwd: [Numpy-discussion] Going to cut NumPy 1.0b5 tonight
1.0b5 Fails to compile? numpy/core/src/arrayobject.c:2694: error: request for member 'ob_type' in something not a structure or union Mac OS X 10.4.7 i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363) python 2.5c1 On Sep 4, 2006, at 7:00 PM, Charlie Moad wrote: -- Forwarded message -- From: Travis Oliphant <[EMAIL PROTECTED]> Date: Sep 4, 2006 7:55 PM Subject: [Numpy-discussion] Going to cut NumPy 1.0b5 tonight To: Discussion of Numerical Python [EMAIL PROTECTED]> This is a last reminder that I'm going to cut a release of NumPy 1.0b5 tonight. Please have any fixes and/or problems worked out before then. -Travis -- --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel smime.p7s Description: S/MIME cryptographic signature - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Fwd: [Numpy-discussion] Going to cut NumPy 1.0b5 tonight
Very sorry: here is the initial error: numpy/core/src/arrayobject.c:564: error: 'op' undeclared (first use in this function) On Sep 5, 2006, at 12:01 AM, Boyd Waters wrote: 1.0b5 Fails to compile? smime.p7s Description: S/MIME cryptographic signature - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
[matplotlib-devel] PATCH -- NumPy 1.0b5 tonight
1.0b5 compiles, with this patch: patch-arrayobject.c.diff Description: Binary data does that look right? - boyd Boyd Waters Scientific Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu On Sep 5, 2006, at 12:05 AM, Boyd Waters wrote: Very sorry: here is the initial error: numpy/core/src/arrayobject.c:564: error: 'op' undeclared (first use in this function) On Sep 5, 2006, at 12:01 AM, Boyd Waters wrote: 1.0b5 Fails to compile? smime.p7s Description: S/MIME cryptographic signature - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel