First SVN commit (for me and mathtext2.py :)

The SoC deadline (for code) is tommorow (Aug 21st.), so I decided to commit
what I have done till now to the repository.

JDH is going on a vacation and will not be able to review it for at
least a week,
but I had to commit it before 21st. Aug - that's the SoC rules. Hopefully,
I'll be adding new stuff the next week (and after), but that doesn't
count as part of SoC anymore...

Since this is my first commit, can anyone please test it. I tested it
only on my windows box.

I changed
__init__.py,
mathtext.py
CHANGELOG

I added
mathtext2.py
mathtext2_demo.py

Anyone who wants to test the new mathtext2 has to add the following line(s)
to the matplotlibrc (mathtext2 is disabled by default):

mathtext2: True # Needed to enable the new mathtext

# Font lines, feel free to change or uncomment (BaKoMa is used by default)
mathtext.rm : FreeSerif.ttf
mathtext.it : FreeSerifItalic.ttf # Text italic
mathtext.tt : FreeMono.ttf # Typewriter (monospaced)
mathtext.mit : FreeSerifItalic.ttf # Math italic
mathtext.cal : FreeSansOblique.ttf # Caligraphic
mathtext.nonascii: FreeSerif.ttf # Used for \sum, \infty etc.

The FreeFont fonts (or any other for that matter) have to be downloaded and put
into the mpl-data dir. The default settingsuse the current bakoma
fonts, and they play pretty well with FreeSerif.ttf as the nonascii
(unicode) font.

so I recommend you just put the line
mathtext.nonascii: FreeSerif.ttf

and comment out the rest (experiment a little with fonts).

Tonight I plan to add support for fractions. Beware that the only
supported backend for now is Agg.

mathtext2_demo.py is attached

mathtext2_demo.py (1.3 KB)

Hi Edin,

The SoC deadline (for code) is tommorow (Aug 21st.), so I decided to commit
what I have done till now to the repository.

JDH is going on a vacation and will not be able to review it for at
least a week,
but I had to commit it before 21st. Aug - that's the SoC rules. Hopefully,
I'll be adding new stuff the next week (and after), but that doesn't
count as part of SoC anymore...

Since this is my first commit, can anyone please test it. I tested it
only on my windows box.

I changed
__init__.py,
mathtext.py
CHANGELOG

I added
mathtext2.py
mathtext2_demo.py

Anyone who wants to test the new mathtext2 has to add the following line(s)
to the matplotlibrc (mathtext2 is disabled by default):

mathtext2: True # Needed to enable the new mathtext

# Font lines, feel free to change or uncomment (BaKoMa is used by default)
mathtext.rm : FreeSerif.ttf
mathtext.it : FreeSerifItalic.ttf # Text italic
mathtext.tt : FreeMono.ttf # Typewriter (monospaced)
mathtext.mit : FreeSerifItalic.ttf # Math italic
mathtext.cal : FreeSansOblique.ttf # Caligraphic
mathtext.nonascii: FreeSerif.ttf # Used for \sum, \infty etc.

The FreeFont fonts (or any other for that matter) have to be downloaded and
put into the mpl-data dir. The default settingsuse the current bakoma
fonts, and they play pretty well with FreeSerif.ttf as the nonascii
(unicode) font.

so I recommend you just put the line
mathtext.nonascii: FreeSerif.ttf

and comment out the rest (experiment a little with fonts).

Tonight I plan to add support for fractions. Beware that the only
supported backend for now is Agg.

mathtext2_demo.py is attached

I just updated my svn repository, added the lines you indicated to my rc file,
but when I run the example, mpl can't find the freefonts that I already have
installed on my system. The freefonts I have installed are not ttf, but pfb.
Where should we download from? ftp://ftp.cs.umn.edu/pub/gimp/pub/gimp/fonts,
for example? I dont think those are what I am looking for. Do they really
need to go in mpl-dir? It would be more appropriate if they could be
installed somewhere like /usr/share/fonts.

···

On Sunday 20 August 2006 10:21 am, Edin Salković wrote:

Because SoC is ending, and the people from Google said we need to
provide the link to the code, I decided to atach the mathtext2.py code
here. I also decided to attach _mathtext_data.py (that does
\texcommand -> unicode char translation). I know this can be seen via
SF's SVN viewer, but, just in case something goes wrong... :wink:

If anyone is having problems with finding unicode fonts, check the
FreeFonts (FreeSerif is the one that has the most characters in it):
http://download.savannah.gnu.org/releases/freefont/
http://download.savannah.gnu.org/releases/freefont/freefont-ttf-20060126.tar.gz

The only currently supported fonts are True/OpenType.

Also, I begun adding support for fractions:
\frac32, \frac3 2 now work (lines are currently not working properly -
I will need to fix some C++ code in the ft2font module)

It's in the SVN (with the mathtext2_demo.py updated).

Cheers, Edin

mathtext2.py (28.1 KB)

_mathtext_data.py (71.9 KB)

···

On 8/20/06, Darren Dale <dd55@...143...> wrote:

Hi Edin,

On Sunday 20 August 2006 10:21 am, Edin Salković wrote:
> The SoC deadline (for code) is tommorow (Aug 21st.), so I decided to commit
> what I have done till now to the repository.
>
> JDH is going on a vacation and will not be able to review it for at
> least a week,
> but I had to commit it before 21st. Aug - that's the SoC rules. Hopefully,
> I'll be adding new stuff the next week (and after), but that doesn't
> count as part of SoC anymore...
>
> Since this is my first commit, can anyone please test it. I tested it
> only on my windows box.
>
> I changed
> __init__.py,
> mathtext.py
> CHANGELOG
>
> I added
> mathtext2.py
> mathtext2_demo.py
>
> Anyone who wants to test the new mathtext2 has to add the following line(s)
> to the matplotlibrc (mathtext2 is disabled by default):
>
> mathtext2: True # Needed to enable the new mathtext
>
> # Font lines, feel free to change or uncomment (BaKoMa is used by default)
> mathtext.rm : FreeSerif.ttf
> mathtext.it : FreeSerifItalic.ttf # Text italic
> mathtext.tt : FreeMono.ttf # Typewriter (monospaced)
> mathtext.mit : FreeSerifItalic.ttf # Math italic
> mathtext.cal : FreeSansOblique.ttf # Caligraphic
> mathtext.nonascii: FreeSerif.ttf # Used for \sum, \infty etc.
>
> The FreeFont fonts (or any other for that matter) have to be downloaded and
> put into the mpl-data dir. The default settingsuse the current bakoma
> fonts, and they play pretty well with FreeSerif.ttf as the nonascii
> (unicode) font.
>
> so I recommend you just put the line
> mathtext.nonascii: FreeSerif.ttf
>
> and comment out the rest (experiment a little with fonts).
>
> Tonight I plan to add support for fractions. Beware that the only
> supported backend for now is Agg.
>
> mathtext2_demo.py is attached

I just updated my svn repository, added the lines you indicated to my rc file,
but when I run the example, mpl can't find the freefonts that I already have
installed on my system. The freefonts I have installed are not ttf, but pfb.
Where should we download from? ftp://ftp.cs.umn.edu/pub/gimp/pub/gimp/fonts,
for example? I dont think those are what I am looking for. Do they really
need to go in mpl-dir? It would be more appropriate if they could be
installed somewhere like /usr/share/fonts.

Oops. I haven't had updated the _mathtext_data.py file.

Darren can you check if now everything works properly (even with pfb fonts)?

It turns out that mpl now ships with the BaKoMa fonts in the mpl-data
dir, so I though that putting the unicode fonts there would be fine.
I'll see what I can do regarding integrating mathtext2 with the
current font manager.

···

On 8/21/06, Edin Salković <edin.salkovic@...149...> wrote:

If anyone is having problems with finding unicode fonts, check the
FreeFonts (FreeSerif is the one that has the most characters in it):
Index of /releases/freefont/
http://download.savannah.gnu.org/releases/freefont/freefont-ttf-20060126.tar.gz

The only currently supported fonts are True/OpenType.