mathtext acting weird under macosx backend

First, thank you to whoever did the Mac OS X backend. It’s much faster and smoother, and seems to behave much more reasonably all around. As in, show() actually does what it says it’s supposed to do, and the figures don’t have to be re-sized to draw themselves!

However, there seems to be some kind of strangeness with using mathtext. When an axis label, tick label, title, or other text has any mathtext embedded within it, the font that the entire text object is rendered in changes, becoming larger, and often fuzzier (in an anti-aliased kind of way).

On the plus (though confusing) side, the ticklabels that are being output by the basemap toolkit are now the same size as all my normal ticklabels, even though they appear to contain a mathtext character (the ^\circ for the degrees symbol), whereas previously, all the basemap ticklabels were coming out larger than the rest of my ticklabels, and I didn’t seem to be able to alter them in the normal text object manipulation ways.

I’m running on:

Matplotlib SVN: v6677

Mac OS 10.5.6

macosx backend

python 2.5.1

ipython 0.9.1

After I noticed this the first time, I quit out of the interpreter, and deleted the font cache from my .matplotlib directory, restarted, and the problem persisted.

Any suggestions? I don’t have any of the alternate tex rendering options set in my rcfile, just using plain mathtext.

···

Zane Selvans

Amateur Earthling

zane@…1923…

303/815-6866

http://zaneselvans.org

PGP Key: 55E0815F

Can you please provide a screenshot of what you are seeing?

I don't run Mac OS-X myself, so have no experience with the Mac OS-X-specific backend... however, it appears to be drawing regular text with native APIs (ATSUI etc.) and mathtext using matplotlib's freetype backend and blitting an image. If done correctly, there is no reason why one should be significantly lower quality than the other, but it is an obvious source of *difference*, particularly if font size is being handled differently in each case.

I would suggest to Michiel de Hoon (author of Mac OS-X backend), to implement a full interface to mathtext for his backend (as PDF does, for instance) and do all glyph rendering with ATSUI, or the opposite -- do all glyph rendering by blitting freetype-rendered glyphs -- but not both. I have some concerns about the use of ATSUI, which, while arguably the better text system, will give different results than the Agg backends and cause cross-platform differences between plots, which is something in general we like to avoid.

Cheers,
Mike

Zane Selvans wrote:

···

First, *thank you* to whoever did the Mac OS X backend. It's much faster and smoother, and seems to behave much more reasonably all around. As in, show() actually does what it says it's supposed to do, and the figures don't have to be re-sized to draw themselves!

However, there seems to be some kind of strangeness with using mathtext. When an axis label, tick label, title, or other text has any mathtext embedded within it, the font that the entire text object is rendered in changes, becoming larger, and often fuzzier (in an anti-aliased kind of way).

On the plus (though confusing) side, the ticklabels that are being output by the basemap toolkit are now the same size as all my normal ticklabels, even though they appear to contain a mathtext character (the ^\circ for the degrees symbol), whereas previously, all the basemap ticklabels were coming out larger than the rest of my ticklabels, and I didn't seem to be able to alter them in the normal text object manipulation ways.

I'm running on:
Matplotlib SVN: v6677
Mac OS 10.5.6
macosx backend
python 2.5.1
ipython 0.9.1

After I noticed this the first time, I quit out of the interpreter, and deleted the font cache from my .matplotlib directory, restarted, and the problem persisted.

Any suggestions? I don't have any of the alternate tex rendering options set in my rcfile, just using plain mathtext.


Zane Selvans
Amateur Earthling
zane@…1923… <mailto:zane@…1923…>
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F

------------------------------------------------------------------------

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA