Probably over my head... Trying to get Font Names
Samantha
samantha7395 at hotmail.com
Thu Feb 17 21:43:22 EST 2005
Thanks Mike. I must have not installed the ttfquery and font tools
correctly. I get an error. This error:
Traceback (most recent call last):
File "C:\Python24\Lib\font-getter.py", line 1, in -toplevel-
from ttfquery import _scriptregistry
File "C:\Python24\Lib\site-packages\ttfquery\_scriptregistry.py", line 1,
in -toplevel-
from ttfquery import ttffiles
File "C:\Python24\Lib\site-packages\ttfquery\ttffiles.py", line 10,
in -toplevel-
from ttfquery import describe, findsystem
File "C:\Python24\Lib\site-packages\ttfquery\describe.py", line 2,
in -toplevel-
from fontTools import ttLib
ImportError: No module named fontTools
Like I said I think I am way in over my short head.
S
"Mike C. Fletcher" <mcfletch at rogers.com> wrote in message
news:mailman.2786.1108689703.22381.python-list at python.org...
> If you don't have a GUI library to use, TTFQuery+Fonttools will retrieve
> this information:
>
> from ttfquery import _scriptregistry
> fonts = _scriptregistry.registry.fonts.keys()
> fonts.sort()
> for name in fonts:
> print name
>
> if you do have a GUI, your GUI library will almost certainly have a
> mechanism to retrieve the list of fonts. With wxPython, for instance,
> it's called wxFontEnumerator. If you just want the user to choose a font,
> most GUI libraries already have controls/dialogues that can handle it.
>
> TTFQuery is going out, reading the .ttf fonts with Fonttools and storing
> their metadata in an index for faster access, whereas your GUI library
> will be using a simple API call to retrieve the metadata. That means
> TTFQuery is going to be heavier, but it can, for instance, also give you
> information about fonts not installed on the system.
>
> HTH,
> Mike
>
> TTFQuery:
> http://ttfquery.sourceforge.net/
>
>
> Samantha wrote:
>
>>I am attempting to extract the Font Names from the installed windows
>>fonts. I am having a heck of a time getting these rather than the file
>>names. Examples can be seen by going to Control Panel > Fonts
>>
>>Any help or direction is appreciated.
>>S
> ________________________________________________
> Mike C. Fletcher
> Designer, VR Plumber, Coder
> http://www.vrplumber.com
> http://blog.vrplumber.com
> PyCon is coming...
>
More information about the Python-list
mailing list