SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] New font manager.

From: John H. <jdh...@ac...> - 2004年03月18日 00:13:08
>>>>> "Paul" == Paul Barrett <ba...@st...> writes:
First of all, amazing work. It's very impressive that you made so
many changes from the frontend to the backend to the config file and
everything still works!
 Paul> I've committed a new font manager to CVS. It is based on
 Paul> the W3C Cascading Style Sheet, Level 1 (CSS1) design. It is
 Paul> still rather basic, but does seem to work for most of the
 Paul> backends. Therefore, FontTools, ttfquery, and
 Paul> ttf_font_manager are no longer needed by matplotlib.
Excellent to hear - that was a maintenance nightmare. I'll put in an
admin request to finally get those dir trees purged from CVS.
BTW, I added the agg2 tree to CVS so you should be able to build
matplotlib cleanly with a CVS checkout. No need to copy files and
dirs anymore. I also remove gtkgd, which was never more than a
proof-of-concept backend.
 Paul> The font manager currently handle only TrueType fonts, but
 Paul> should be generalizable to other font types.
 Paul> The text object now has a fontproperties attribute which
 Paul> describes the basic aspects of the font, such as family,
 Paul> style, weight and size. This attribute replaces the
 Paul> fontname, fontangle, fontweight, and fontsize attributes.
 Paul> In future, I would suggest using font name sizes, such as
 Paul> small, medium, and large, to specify font sizes, instead of
 Paul> point sizes. This should make it easier for font sizes to
 Paul> be consistent across backends. It will also make it easier
 Paul> to change all the fonts just by changing the default font
 Paul> size that is associated with the medium font name. The
 Paul> default value for this is 12.
 Paul> The other interface issue to be aware of is the font family.
 Paul> This is a list of font names in order of decreasing
 Paul> priority. This should make it easier to match similar fonts
 Paul> across the various platforms.
I printed out the code so I'll take it home and give it a close
reading tonight. Here are a few things I noticed while poking around
 * we should cite the ttfquery license since some of font_manager code
 appears to be borrowed from it. I added license/LICENSE_TTFQUERY
 to CVS so you can just refer to that file in the font_manager
 header
 * the default file .matplotlibrc in the matplotlib root dir needs to
 be updated with the properties you added to rcParams. With
 comments and commented examples would be most useful. I noticed
 that in the rc params in matplotlib.__init__.py you specify default
 sizes in points rather than relative sizes - what's the logic here?
 * Could you write some tutorial and/or user documentation? The two
 most important files are htdocs/fonts.html.template and
 htdocs/backends.html.template. Also, a blurb for "what's new" for
 the next release would be great. It might also be nice to have
 something along the lines of a FAQ "Hey my fonts have changed, how
 can I get the old ones back?" in htdocs/faqs.html.template
 * It does not appear you are cacheing the results anywhere. On my
 modern linux system with not so many fonts, I don't notice any
 performance hit. I wonder if this might be a problem for a win32
 user with lots of ttf files and a not so speedy computer.
 * I have some concern about the finder algorithm, at least in
 combination with setting a default font in matplotlibrc. Eg, if I
 untar the following dir on my linux system (which contains a lot of
 ttf fonts) http://nitace.bsd.uchicago.edu:8080/files/share/ttf.tar
 and then point to them with my TTFPATH, and set 
 text.fontname : Vera in matplotlibrc, I don't get Vera. 
 This may be answered by the FAQ above :-)
Many thanks!
John Hunter

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 によって変換されたページ (->オリジナル) /