SourceForge logo
SourceForge logo
Menu

[matplotlib-devel] freetype font finder : any volunteers?

From: John H. <jdh...@ac...> - 2004年02月13日 14:10:49
Almost all of the backends (save postscript) either support freetype
or are capable or supporting it. We need a good cross-platform
freetype font finder package. Right now, we have fonttools and
TTFQuery, which get the job done. But they bring a lot of extra
installation overhead.
For the postscript backend, I wrote a standalone AFM parser which has
worked well - the alternative was to require fonttools, which is
larger than all of matplotlib combined. I would like to have the same
for TTF files - a small, free standing module with no extrinsic
dependencies that we can ship with matplotlib.
A introduction to the ttf specification can be found here
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08.
We don't need much out of these files: things like character sizes,
kerning distances, etc, are already handled by the freetype extension
modules, eg, paint.font (which I also used for agg). 
What we need is for someone to identify the relevant *.ttf dirs on the
major platforms (you can extract most of this information from
TTFQuery), and parse enough of the ttf file to get family name, font
style, weight, etc.... You could either pull out the relevant bits
from fonttools and ttfquery or just roll your own. Ideally, you
should be able to take a matplotlib.text.Text instance and returns the
ttf file which is the closest match for you on your system, falling
back on Vera (which ships with matplotlib) as the default.
I notice on
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08#3054f18b
there is a field for "Postscript name for the font" which would be
nice to incorporate for backend switching (saving PS from GTK,
etc...).
Anyway, it would be a very useful addition to matplotlib, and would
speed the process of standardizing fonts across the backends.
JDH

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /