FOM Reference > Formatting > Datatypes > fFontFamily interface
  
fFontFamily interface
Objects of this class represent font families, i.e. collections of similar type faces with variations for different attributes such as italic style or various weights. Each object has several variants that store instances of fTypeface at known indexes, corresponding to the available variants of that particular font family. When a font family is used to specify a font (for example, when setting the fStyle.font property), it's easy to switch between its variants by using the properties fStyle.italic, fStyle.stretch and fStyle.weight. Alternatively, different fonts assigned to the variants array can be accessed by changing the fStyle.variant property.
This object inherits from fFont.
FontVariants enumeration
These constants define which indexes commonly take the various typeface variants for a font family. This slot configuration must be followed in order for fStyle properties such as weight, italic and stretch to work as expected. The constants should be added to get the index for a typeface with the appropriate combination of attributes.
The FontVariants enumeration has the following constants of type int.
VARIANT_ITALIC = 1
Bit mask for an italic style font, corresponding to fStyle.italic.
VARIANT_BOLD = 2
Bit mask for a bold weight font, corresponding to fStyle.weight.
VARIANT_LIGHT = 4
Bit mask for a light weight font, corresponding to fStyle.weight.
VARIANT_CONDENSED = 8
Bit mask for a condensed font, corresponding to fStyle.stretch.
VARIANT_EXPANDED = 16
Bit mask for an expanded font, corresponding to fStyle.stretch.
defaultTypeface attribute
The default typeface to use when the requested variant is not available in this font family.
defaultTypeface
Access
read-write
Returns
fTypeface
variants attribute
This array contains the fTypeface objects that make up this font family at the index corresponding to the sum of the FontSlots constants for different combinations of font styles. If a particular combination is not available in this font family, the corresponding slot is null.
If the pre-defined constants such as VARIANT_ITALIC are used as indexes, the appropriate fonts will be chosen when using the properties fStyle.italic, fStyle.stretch and fStyle.weight to select the desired variant.
Alternatively, to use a specific variant of a font family, set fStyle.variant to the desired index into this array after setting fStyle.font to this font family.
variants
Access
read-only
Returns
fTypeface[]
readResolve method
Return the object corresponding to the given serialized representation.
readResolveobj
Parameters
Objectobj
The serialized representation.
Returns
fFontFamily. The object corresponding to the serialized representation.
writeReplace method
Create a serializable representation of this object.
writeReplace
Parameters
None
Returns
Object. A serializable representation of this object.