mpl integration

2 views
Skip to first unread message

Ondrej Certik

unread,
Sep 8, 2009, 6:40:52 PM9/8/09
to matht...@googlegroups.com
Hi,

so mathtex now works with matplotlib in the mathtex branch. What needs
to be done, so that this branch can be merged with the main matplotlib
branch?

Let's get it done, if you all agree that's the way to go.

Ondrej

Michael Droettboom

unread,
Sep 9, 2009, 11:03:23 AM9/9/09
to matht...@googlegroups.com
I don't want to do the merge until all regressions have been fixed. 

I just merged trunk into the branch in preparation for merging it back.  I'm noticing a few issues, which I haven't looked into deeply, so I don't know how much work is involved.

- Hinting is not dealt with -- it should be on for the image backend and off for vector backends.  Small point, but since I don't know the current code layout very well, it might take some time.

- The placement of math is broken in the PDF and SVG backends

- The new TextPath functionality in matplotlib needs to be updated to use the external mathtex.  This may require adding a new backend to mathtex.

- In general, the code duplication between mathtex and matplotlib bothers me from a maintenance standpoint (FT2Font, PNG, font_manager etc.), but I suppose perfect is the enemy of good here.  We still have plenty of work for someone who wants to release the font functionality as a separate package.

I would also like feedback from you, Ondrej, or the Sympy folks about whether the standalone mathtex meets your requirements to prevent further refactoring later.

Mike
--
Michael Droettboom
http://www.droettboom.com/

Sent from my MacBook Wheel

This message is confidential, intended only for the named recipient(s) and may contain information that is privileged or exempt from disclosure under applicable law. If you are not the intended recipient(s), you are notified that any dissemination, distribution, or copying of this message is strictly prohibited.

Freddie Witherden

unread,
Sep 9, 2009, 11:43:18 AM9/9/09
to matht...@googlegroups.com
Hi,

On 9 Sep 2009, at 16:03, Michael Droettboom wrote:
> - Hinting is not dealt with -- it should be on for the image backend
> and off for vector backends. Small point, but since I don't know
> the current code layout very well, it might take some time.

Currently the hinting used is the default provided by FreeType. This
should not be too hard to add in, although the Mathtex class has no
way of knowing ahead of time how a specific equation will be rendered
(rendering and box generation are de-coupled). But adding a manual
override shouldn't be difficult.

> - The placement of math is broken in the PDF and SVG backends

Interesting, as I spent quite a while on the PS/PDF/SVG backends
working on the base-line alignment. It is possible a more recent
commit of mine broke this without me noticing.

> - In general, the code duplication between mathtex and matplotlib
> bothers me from a maintenance standpoint (FT2Font, PNG, font_manager
> etc.), but I suppose perfect is the enemy of good here. We still
> have plenty of work for someone who wants to release the font
> functionality as a separate package.

The font manager code is possibly the biggest issue here. Mathtex will
happily use the FT2Font and PNG managers from matplotlib, if
available. The font manager, however, has had quite a bit of work done
to it compared to the matplotlib one. This is because mathtex does not
require as sophisticated handling as matplotlib.

Regards, Freddie.

Reply all
Reply to author
Forward
0 new messages