The singleton “registry” object (an instance of ttfquery.ttffiles.Registry
is the only member of note). This registry with be created in a file
in the user’s $HOME directory .font.cache if the $HOME environment variable
is defined. Otherwise will be created in the ttfquery source code directory
(which is obviously not a very good solution).

In essence, this is the “interpretation” of the font
as geometric primitives. I only support line and
quadratic (conic) segments, which should support most
TrueType fonts as far as I know.

The process consists of first scanning for any multi-
off-curve control-point runs. For each pair of such
control points, we insert a new on-curve control point.

Once we have the “expanded” control point array we
scan through looking for each segment which includes
an off-curve control point. These should only be
bracketed by on-curve control points. For each
found segment, we call our integrateQuadratic method
to produce a set of points interpolating between the
end points as affected by the middle control point.

All other control points merely generate a single
line-segment between the endpoints.

There is some fudging going on here as I
workaround what appears to be a problem with the
specification for sTypoDescender, which states
that it should normally be a negative value, but
winds up being positive in at least one font that
defines points below the zero axis.

XXX The entire OS/2 table doesn’t appear in a few

fonts (symbol fonts in particular), such as Corel’s
BeeHive and BlackLight 686.

This should only be used as a backup in case there is
no proper available querying mechanism (i.e. fonttools),
and even then, we really would rather avoid using this
extremely fragile mechanism.

Basically what happens is that a name compression function
is run over the font name, as seen in the Windows Registry,
producing a base name and a set of modifiers, with the
modifiers being the weight (as a string) and a flag
indicating whether the font appears to be italicised.

XXX This is English-specific and entirely dependent on the

naming conventions commonly seen when naming fonts, so
there will be a considerable number of cases where the
resulting name and flags will be incorrect.

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.

filenames – if provided, list of filenames to scan,
otherwise the full set of system fonts provided
by findsystem will be used.
failureCallback – if provided, a function taking three
arguments, the failing filename, an error-type code,
and the error object. If processing should stop,
raise an error.
codes: