| |
Methods defined here:
- __init__(self)
- Initialize the Registry
- clear(self)
- Clear out the all tables and mark unchanged
- dirty(self, dirty=1)
- Mark the registry as changed/unchanged
- familyMembers(self, major, minor=None)
- Get all (general) fonts for a given family
- fontFile(self, specificName)
- Return the absolute path-name for a given specific font
- fontForms(self, fontName)
- Retrieve the set of font-forms (weight,italics) available in a font
- fontMembers(self, fontName, weight=None, italics=None)
- Get specific font names for given generic font name
weight -- if specified, only members with the given weight
italics -- if specified, only members where the flag matches
returns list of specific font names
- load(self, file, clearFirst=1)
- Attempt to load the font metadata from a pickled file
file -- a file open in binary read mode or a filename
clearFirst -- if true, clear tables first, and reset DIRTY
to 0 after finished
- matchName(self, name, single=0)
- Try to find a general font based on a name
- metadata(self, filename, force=0)
- Retrieve metadata from font file
filename -- fully specified path to the font file
force -- if false, and the metadata is already
available for this file, do not access the
font file to retrieve, just return the existing
metadata.
return value:
tuple of:
filename -- fully specified absolute path
modifiers -- (weightInteger, italicsFlag)
specificName -- specific name of the particular
font stored in the given file, the name of
the "modified" font
fontName -- name of the general font which
the modifiers are specialising
specifier -- family specifier, two-tuple of
high-level and sub-level font classifications
based on font characteristics as encoded
in the font file.
- register(self, filename, modifiers=None, specificName=None, fontName=None, familySpecifier=None, force=0)
- Do the actual registration of a filename & metadata
See metadata function for description of the various
arguments. If modifiers == None then the metadata function
will be used to scan for the metadata.
force -- if true, force re-reading font-file even if we already
have the meta-data for the file loaded.
- save(self, file=None, force=0)
- Attempt to save the font metadata to a pickled file
file -- a file open in binary write mode or a filename
force -- if not true and DIRTY false, then don't actually
save anything
returns number of records saved
- scan(self, paths=None, printErrors=0, force=0)
- Scan the given paths registering each found font
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- DIRTY = 0
- filename = ''
|