[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] road to 1.6
Anthony Baxter wrote:
"Mike C. Fletcher" wrote
Oh, question, is Anthony's system-TTF-file-finding code available for
inclusion in a BSD-licensed project (OpenGLContext)? I'd like to use an
already-available mechanism rather than have to roll my own for use with
PyGame and FontTools font-providers.
Sure, go for it.
One change I'd like to make before it goes into pygame proper is
to switch from XLFD-style names to Xft-style names. The latter suck
far less than the former.
http://keithp.com/~keithp/talks/xtc2001/paper/xft.html#sec-xft-name
Anthony.
Sorry to be anal about this, but what I'd actually need is to have the
"LGPL" notice in the file changed (by the copyright holder, which is
currently Pete according to the file) to state that the module is
released under a BSD license, so that I can include the file in the
BSD-licensed project. (I really don't like the idea of modifying a
copyright/license notice for someone else's module).
BTW, using something like this should get the list of registered font
directories on RedHat Linux (and, by the look of it, a few other
distros), this will include such things as the OpenOffice .ttf
directory, and any other system-registered font diretories.
def linuxFontDirectories( ):
"""Get system font directories on Linux/Unix
Uses /usr/sbin/chkfontpath to get the list
of system-font directories, note that many
of these will *not* be truetype font directories.
If /usr/sbin/chkfontpath isn't available, uses
returns a set of common Linux/Unix paths
"""
executable = '/usr/sbin/chkfontpath'
import os, re
if os.path.isfile( executable ):
data = os.popen( executable ).readlines()
match = re.compile( '\d+: (.+)')
set = []
for line in data:
result = match.match( line )
if result:
set.append(result.group(1))
return set
else:
return [
"/usr/X11R6/lib/X11/fonts/TTF/",
"/usr/lib/openoffice/share/fonts/truetype/",
"/usr/share/fonts",
]
Enjoy all,
Mike
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/