[Pythonmac-SIG] list of fonts

Bob Ippolito bob at redivi.com
Sun Jul 18 01:53:03 CEST 2004


On Jul 17, 2004, at 6:44 PM, Jack Jansen wrote:

>
> 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()?

Probably because there aren't any classes in _Fm ;)

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3589 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040717/9ab25d60/smime.bin


More information about the Pythonmac-SIG mailing list