[Pythonmac-SIG] list of fonts

Jack Jansen Jack.Jansen at cwi.nl
Sun Jul 18 00:44:44 CEST 2004


On 17 Jul 2004, at 15:34, Arthur Elsenaar wrote:
> how do I get a list of the available system fonts? I tried doing this 
> in pygame, but the darwin code to do this is unimplemented. I see a 
> carbon.fm (font manager) module, but how does this work?

Carbon.Fm probably won't do you much good, it's tied too much to 
QuickDraw. Also, I don't think it lets you enumerate over the available 
fonts. Bob's suggestion is the easiest, if you can use Cocoa.

But anyway, here's an easy recipe for finding out what is in the 
various Carbon modules, what they do, and how to call them:
 >>> import Carbon.Fm
 >>> help(Carbon.Fm)
This will tell you the names an Python calling sequences of the 
functions.
The functions you can now lookup in the Apple documentation (for 
instance from within Xcode).

Unfortunately it will not tell you the names of the classes right now, 
you'll either have to guess or use dir() for that. Then you can do 
help() on the class, and find out about the methods.

BTW: does anyone know *why* the classes don't get listed by help()?
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman



More information about the Pythonmac-SIG mailing list