Re: [matplotlib-devel] PDF backend (was: A question about cbook.is_string_like)

2006-11-06 Thread Nicolas Grilly
> "Nicolas Grilly" <[EMAIL PROTECTED]> writes:
> > I've just some issues with:
> > - text alignment (I fixed it on my working copy of matplotlib);
>
> Great! Is there a patch somewhere?

Yes, I'm preparing one and I'll submit it in the next few days.

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] PDF backend

2006-11-06 Thread Nicolas Grilly
On 11/5/06, Jouni K Seppanen <[EMAIL PROTECTED]> wrote:
> Does anyone here have experience with subsetting TrueType fonts (or
> Type 1 or OpenType, for that matter)? One pretty frequent complaint is
> that the eps files produced by matplotlib can be huge because they
> include the full font. Nowadays some popular fonts include characters
> for Greek, Cyrillic, Hebrew, Arabic, and possibly even Chinese,
> Japanese, and Korean, so a font can be several megabytes large.

I do not have experience in subsetting TrueType fonts, but I read the
pure Python code dedicated to this task in ReportLab:


http://www.reportlab.co.uk/svn/public/reportlab/trunk/reportlab/pdfbase/ttfonts.py

It proves it's possible to achieve it in pure Python, without
requiring fonttools. And it can be a good source of inspiration.
Perhaps the licence is compatible with matplotlib's one?

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] PDF backend

2006-11-06 Thread John Hunter
> "Nicolas" == Nicolas Grilly <[EMAIL PROTECTED]> writes:

Nicolas> It proves it's possible to achieve it in pure Python,
Nicolas> without requiring fonttools. And it can be a good source
Nicolas> of inspiration.  Perhaps the licence is compatible with
Nicolas> matplotlib's one?

it is BSD which is compatible-- it appears that ttfonts pull in a bit
more or report lab, but this might be worth looking into.  I don't
know if and how the techniques cold be generalized to PS embedding.  I
think the problem Paul ran into (who did the PS embedding work) was
not getting the relevant info for specific glyphs, but how to write
the postscript to encode the subset.

JDH

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Question about ft2font.get_charmap

2006-11-06 Thread Nicolas Grilly
Hi Paul,

On 11/6/06, Paul Barrett <[EMAIL PROTECTED]> wrote:
> The ft2font module provides a Python interface to the FT2Font C API.
> get_charmap is one of the methods in this API as is set_charmap.  A
> font can have multiple character maps.

Ok.

> get_charmap() returns the default one.  Others can be specified
> by providing an argument to get_charmap(). To add a new charmap
> to the font, you must first find out what charmaps it contains,
> so get_charmap is needed for this.

I disagree. Method FT2Font::get_charmap doesn't return the list of
available character maps; it returns a dictionary mapping glyph
indices to character codes in the *current character map*.

You wrote "other character maps can be specified by providing an
argument to get_charmap", but method FT2Font::get_charmap doesn't
accept any parameter (I looked at line 1208 of file ft2font.cpp).

> In addition, changing this method to return the reverse mapping would
> violate the rule of least surprise.

Yes, but in my opinion, this is the current solution that violates
"the rule of least surprise".

Method FT2Font::get_charmap calls two important methods of FreeType:
FT_Get_First_Char and FT_Get_Next_Char. These two methods are used to
parse all character codes from first to last in the current character
map, and returning corresponding glyphs.

You can read those methods description and an example at this URL:
http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Get_First_Char

Reading this example, it seems apparent the "least surprising
solution" is a mapping from character codes to glyph indices, doesn't
it?

> Note that creating the reverse dict is easy in Python.

Yep, it's why we love programming in Python!

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel