TTFQuery for Python
TTFQuery builds on the FontTools package to allow the Python
programmer to accomplish a number of tasks:
- query the system to find installed fonts
- retrieve metadata about any TTF font file (even those not yet
installed)
- abstract family type
- proper font name
- glyph outlines
- build simple metadata registries for run-time font matching
With these functionalities, it is possible to readily create OpenGL
solid-text rendering libraries which can accept abstract font-family
names as font specifiers and deliver platform-specific TTF files to
match those libraries. TTFQuery doesn't provide rendering
services, but a sample implementation can be found in the OpenGLContext project,
from which TTFQuery was refactored.
TTFQuery can be downloaded from the project page on SourceForge. You will
obviously need the FontTools package
installed to use it, and that in turn requires the Numeric
Python (numpy) package.
Changes
Version 1.0.0
- Workaround for bug in Fonttools handling of Unicode filenames (as
reported by the Win32 registry), this workaround should work even after
the bug is fixed in Fonttools.
Version 1.0.0a1
- Fix to win32InstalledFonts function for Win98 systems, was
incorrectly assuming that os.name would be something other than 'nt' on
Win98. Now tries both possible keys and uses the first that works.
Version 0.2.6
- Another patch from John Hunter for the registry-scanning code.
Version 0.2.5
- Patch to store "script" registry in home directory on Linux --
John Hunter
- Patches to registry load/save methods (fix bug with use of
self.filename) and registry-retrieval function -- John Hunter
Note: there's no reason to update from 0.2.4 for
OpenGLContext users, as none of the patched errors affect
OpenGLContext's use of the package.
Version 0.2.4
- can query Win32 directly for all registered fonts
- added Mac OS X font directories to list of possible font
directories for Unix-like OSes