Class representing a font that has been registered for use with FOray. RegisteredFont is not really a Font, as it is not part of the Font hierarcy (i.e. it does not subclass Font). It is really the bridge between the font configuration and the actual Font classes. It first encapsulates the information from the "font" element in the font-configuration. During font resolution, a RegisteredFontDesc element (representing a "font-description" element in font-configuration) is selected, which in turn points to RegisteredFont instance. It then, as requested, converts that information into actual Font instances that can be used by the client application.
It is tempting to question why this separate class is needed. Because fonts can be registered from several sources (hard-coded, font configuration, operating system registration, and directly by the client application), a separate registry concept ensures that all of the registered fonts can be managed, even though they may not have been parsed yet. It is good to not parse the font until it is known to be necessary. Note that the data stored in RegisteredFont corresponds to the data passed in the <font> element of the font configuration file. Data from the actual font file itself tends to be stored in FreeStandingFont or one of its subclasses.
|
|