Thanks!
I apologise for keeping the development in obscurity. The procedure
(the best I could come up with):
1) Here are a set of test fonts:
http://download.savannah.gnu.org/releases/freefont/freefont-ttf-20060126.tar.gz
Make sure you extract the files FreeSerif.ttf, FreeMono.ttf to the mpl-data dir.
2) Changes needed to the files: You have to change __init__.py and
mathtext.py (the files are attached) and you also have to add some
lines to matplotlibrc (also attached).
The __init__.py/matplotlibrc changes are trivial:
# mathtext settings
'mathtext.unicode' : [False, validate_bool], # Needed to enable Unicode
# fonts used by mathtext
'mathtext.rm' : ['FreeSerif.ttf', str], # Roman (normal)
'mathtext.it' : ['FreeSerif.ttf', str], # Italic
'mathtext.tt' : ['FreeMono.ttf', str], # Typewriter (monospaced)
'mathtext.cal' : ['cmsy10.ttf', str], # Caligraphic
Although the default setting for 'mathtext.unicode' is False, the
attached matplotlibrc sets it to True.
The mathtext.py changes are also trivial.
3) mathtext_demo.py will do as a test script. I have added some TeX
symbols to the mathtext_demo.py that is attached with this e-mail.
Note that the attached mathtext_demo.py saves a png, svg and ps file
in the working dir.
Again, I didn't want to commit to the svn, because, as a newbie, I'm
not completely sure if the proposed changes will break something, or
if I should have done things differently.
Any feedback is welcome, only note that the current parsing doesn't
allow some things that in plain TeX you take for granted (I'm
developing a new parser already). The changes only show the current
state of Unicode support in the Font classes.
Cheers
Edin
init.py|attachment (39.7 KB)
mathtext.py (54.3 KB)
matplotlibrc (12.1 KB)
mathtext_demo.py (700 Bytes)
···
On 8/2/06, John Hunter <jdhunter@...5...> wrote:
OK, but I reiterate my point from my last post on the subject. The
work you have done previously as far as I understand is still not
usable. You need to develop a system wherein mathtext can be used
with a set of unicode fonts, so that when the STYX fonts are released
we can use them. Even if the example font set does not have full
coverage, we need to develop a prototype so that users and developers
can test your work. Something like
- here are a set of test fonts: http://some.web.site
- here are the changes you need to make to your rc file
- here is a test script