Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Friends
IlvFontManager Class Reference

Font manager class. More...

#include <ilviews/base/font/IlvFontManager.h>

Public Member Functions

IlvFontdefaultBoldFont () const
 Gets the default bold font. More...
 
IlvFontdefaultFont () const
 Gets the default font. More...
 
IlvFontdefaultItalicFont () const
 Gets the default italic font. More...
 
IlvFontdefaultLargeFont () const
 Gets the default large font. More...
 
IlvFontdefaultNormalFont () const
 Gets the default normal font. More...
 
const char *const * getFamilyNames (IlUShort &count) const
 Gets font family names. More...
 
IlvFontgetFont (const char *fontFamily, IlvFontSize fontSize, IlvFontStyle fontStyle=IlvNormalFontStyle, const char *foundry=0)
 Gets a font. More...
 
IlvFontgetFont (const char *fontName)
 Gets a font. More...
 
IlvDimgetFontSizes (const char *fontFamily, IlvFontStyle fontStyle, int &count, const char *foundry=0) const
 Gets font sizes. More...
 

Friends

class IlvDisplay
 
class IlvFont
 

Detailed Description

Font manager class.

This class handles the fonts of an IlvDisplay. IlvFontManager provide IlvFont font objects. It informs about font sizes, font availability

Member Function Documentation

◆ defaultBoldFont()

IlvFont* IlvFontManager::defaultBoldFont ( ) const

Gets the default bold font.

This font can also be retrieved using getFont("bold").

On Unix, the default value is built from the font name "%helvetica-12-B".

On Windows, this font corresponds to a bold version of the HFONT that is returned by GetStockObject(DEFAULT_GUI_FONT).

Returns
A pointer to the default bold font, as defined by the "boldfont" display resource.

◆ defaultFont()

IlvFont* IlvFontManager::defaultFont ( ) const

Gets the default font.

Returns
A default font that you can use immediately after the session is launched.

◆ defaultItalicFont()

IlvFont* IlvFontManager::defaultItalicFont ( ) const

Gets the default italic font.

This font can also be retrieved using getFont("italic").

On Unix, the default value is built from the font name "%helvetica-12-I".

On Windows, this font corresponds to an italic version of the HFONT that is returned by GetStockObject(DEFAULT_GUI_FONT).

Returns
A pointer to the default normal font, as defined by the "italicfont" display resource.

◆ defaultLargeFont()

IlvFont* IlvFontManager::defaultLargeFont ( ) const

Gets the default large font.

This font can also be retrieved using getFont("large"). On Unix, the default value is built from the font name "%helvetica-18-B".

On Windows, this font corresponds to the HFONT that is returned by GetStockObject(DEFAULT_GUI_FONT), six points bigger.

Returns
A pointer to the default normal font, as defined by the "largefont" display resource.

◆ defaultNormalFont()

IlvFont* IlvFontManager::defaultNormalFont ( ) const

Gets the default normal font.

This font can also be retrieved using getFont("normal").

Returns
A pointer to the default normal font, as defined by the "normalfont" display resource.

On Unix, the default value is built from the font name "%helvetica-12-".

On Windows, this font corresponds to the HFONT that is returned by GetStockObject(DEFAULT_GUI_FONT).

◆ getFamilyNames()

const char* const* IlvFontManager::getFamilyNames ( IlUShort count) const

Gets font family names.

Parameters
countThe length of the returned array.
Returns
An array of sorted family font names. This array is overwritten at each call and should never be deleted. The number of available family fonts is stored in the count parameter.

◆ getFont() [1/2]

IlvFont* IlvFontManager::getFont ( const char *  fontFamily,
IlvFontSize  fontSize,
IlvFontStyle  fontStyle = IlvNormalFontStyle,
const char *  foundry = 0 
)

Gets a font.

Retrieves the font object having the given characteristics. This method lets you specify the font family, the font size, the font style, and optionally the font foundry.

Parameters
fontFamilyThe name of the font family.
fontSizeThe size of the font.
fontStyleThe style of the font.
foundryThe font foundry.
Returns
The font with the specified characteristics.

◆ getFont() [2/2]

IlvFont* IlvFontManager::getFont ( const char *  fontName)

Gets a font.

Retrieves the font object of the given fontName. This behavior is system-dependent. If the name begins with a '%' character, then Rogue Wave Views tries to create a full font object from the value stored in the name string, which must have the form: fontName-fontSize-fontFlags where fontName is the family name of the font, such as courier, helvetica or times; fontSize is an integer value that gives the font's size; fontFlags is a series of characters that indicates the font style: B for bold, I for italic and U for underlined. This field can be empty for a normal font.

You may specify the font foundry on systems where conflicts may appear. This parameter is highly system-dependent. The foundry then appears at the end of the Rogue Wave Views font name, after an additional dash.

Parameters
fontNameThe name of the font object, or a string in the format fontName-fontSize-fontFlags that also may provide size and style flags, and a font foundry.
Returns
The font object having the given name, or 0 if such a font cannot be created.

◆ getFontSizes()

IlvDim* IlvFontManager::getFontSizes ( const char *  fontFamily,
IlvFontStyle  fontStyle,
int &  count,
const char *  foundry = 0 
) const

Gets font sizes.

Can be used to know what sizes are available for the font family fontFamily, if given the style fontStyle and optionally foundry. An array of sorted valid sizes is returned. This array is overwritten at each call, and should never be deleted. The length of this array is stored in the count parameter. On systems that have scalable fonts, the first element of this array is 0. That means that you can allocate a font that has these characteristics, and any possible size.

Parameters
fontFamilyThe name of the font family.
fontStyleThe style of the font.
countThe length of the return array.
foundryThe font foundry.
Returns
The valid sizes of the font with the specified characteristics.