[matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Nicolas Grilly
Hello everybody, I'm in the process of replacing R by matplotlib to plot all of our charts. I'm hacking the PDF backend because I need this format to import charts in ConTeXt (this is TeX macro package, similar to LaTeX, we use to produce PDF reports). My first question, very basic, is why

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Gael Varoquaux
On Sun, Nov 05, 2006 at 06:07:50PM +0100, Nicolas Grilly wrote: I'm hacking the PDF backend because I need this format to import charts in ConTeXt (this is TeX macro package, similar to LaTeX, we use to produce PDF reports). I am all for a good PDF backend, but you should be aware that under

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Gael Varoquaux
On Sun, Nov 05, 2006 at 09:27:54AM -0800, Andrew Straw wrote: When I get back to that manuscript (ahem), I'll probably try to bang the PDF backend further into shape. That would be great for pdf generation under windows, where you can hardly assume the user has xpdf or epstopdf installed. It

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Nicolas Grilly
Hi Andrew, Andrew Straw [EMAIL PROTECTED] wrote: I'm not speaking with the authority of one who actually wrote the function or uses it, so I don't know the specific reasons, if there are any. However, this kind of thing is common (and encouraged) practice in Python. It's a use of duck typing.

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Nicolas Grilly
On 11/5/06, Andrew Straw [EMAIL PROTECTED] wrote: BTW, what's the official status of the PDF backend? Last I checked (a month or so ago), it seemed to work fine, has a couple of Python 2.4-isms, but was generally great. I was surprised that it didn't appear to make it onto the list of

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread John Hunter
Andrew == Andrew Straw [EMAIL PROTECTED] writes: Andrew BTW, what's the official status of the PDF backend? Last Andrew I checked (a month or so ago), it seemed to work fine, has Andrew a couple of Python 2.4-isms, but was generally great. I Andrew was surprised that it didn't

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread John Hunter
Nicolas == Nicolas Grilly [EMAIL PROTECTED] writes: Nicolas But in this function, I don't like the idea to try an Nicolas operation on a string, and wait for an exception in order Nicolas to know if we really have a string or not. It's not very Nicolas efficient, nor very

[matplotlib-devel] Question about ft2font.get_charmap

2006-11-05 Thread Nicolas Grilly
In module ft2font, the method FT2Font.get_charmap returns a dict that maps glyph indices to char codes. I don't understand the purpose of this mapping, and why the method doesn't return the reverse mapping, i.e. char codes mapped to glyph indices. For example, in backend_ps.py, line 754, the

Re: [matplotlib-devel] PDF backend

2006-11-05 Thread John Hunter
Jouni == Jouni K Seppanen [EMAIL PROTECTED] writes: Jouni able to do font subsetting. I was going to look into the Jouni Fonttools library by Just van Rossum, but lately I've been Jouni too busy with other things to. FYI, matplotlib used to depend on fonttools, but we found the

Re: [matplotlib-devel] A question about cbook.is_string_like

2006-11-05 Thread Jouni K Seppanen
Nicolas Grilly [EMAIL PROTECTED] writes: [about is_string_like] But in this function, I don't like the idea to try an operation on a string, and wait for an exception in order to know if we really have a string or not. It's not very efficient, nor very beautiful. I wouldn't worry about