CompositeFont class is the implementation of logical font classes.
Every logical font consists of several physical fonts that described
in font.properties file according to the face name of this logical font.
CompositeFont(String familyName, String faceName, int _style, int _size, FontProperty[] fProperties, FontPeerImpl[] physFonts) Creates CompositeFont object that is corresponding to the specified logical
family name.
Method Summary
public boolean
canDisplay(char chr) Returns true if one of the physical fonts composing this font CompositeFont
can display specified character.
public int
charWidth(int ind) Returns width of the char with specified index.
public int
charWidth(char c) Returns width of the specified char.
getMaxCharBounds(FontRenderContext frc) Returns maximum rectangle that encloses all maximum char bounds of
physical fonts composing this CompositeFont.
getStringBounds(char[] chars, int start, int end, FontRenderContext frc) Returns rectangle that bounds the specified string in terms of composite line metrics.
Creates CompositeFont object that is corresponding to the specified logical
family name.
Parameters: familyName - logical family name CompositeFont is to be created from Parameters: faceName - logical face name CompositeFont is to be created from Parameters: _style - style of the CompositeFont to be created Parameters: _size - size of the CompositeFont to be created Parameters: fProperties - an array of FontProperties describing physical fonts - parts of logical font Parameters: physFonts - an array of physical font peers related to the CompositeFontto be created
Returns the index of the FontPeer in array of physical fonts that is applicable
for the given character. This font has to have the highest priority among fonts
that can display this character and don't have exclusion range covering
specified character. If there is no desired fonts -1 is returned.
Parameters: chr - specified character index of the font from the array of physical fonts that will be used during processing of the specified character.
getCharFontIndex
public int getCharFontIndex(char chr, int defaultValue)(Code)
Returns the index of the FontPeer in array of physical fonts that is applicable
for the given character. This font has to have the highest priority among fonts
that can display this character and don't have exclusion range covering
specified character. If there is no desired fonts default value is returned.
Parameters: chr - specified character Parameters: defaultValue - default index that is returned if the necessary font couldn't be found. index of the font from the array of physical fonts that will be used during processing of the specified character.
Returns maximum rectangle that encloses all maximum char bounds of
physical fonts composing this CompositeFont.
Parameters: frc - specified FontRenderContext
Returns rectangle that bounds the specified string in terms of composite line metrics.
Parameters: chars - an array of chars Parameters: start - the initial offset in array of chars Parameters: end - the end offset in array of chars Parameters: frc - specified FontRenderContext