Font manager class. More...
#include <ilviews/base/font/IlvFontManager.h>
Public Member Functions | |
IlvFont * | defaultBoldFont () const |
Gets the default bold font. More... | |
IlvFont * | defaultFont () const |
Gets the default font. More... | |
IlvFont * | defaultItalicFont () const |
Gets the default italic font. More... | |
IlvFont * | defaultLargeFont () const |
Gets the default large font. More... | |
IlvFont * | defaultNormalFont () const |
Gets the default normal font. More... | |
const char *const * | getFamilyNames (IlUShort &count) const |
Gets font family names. More... | |
IlvFont * | getFont (const char *fontFamily, IlvFontSize fontSize, IlvFontStyle fontStyle=IlvNormalFontStyle, const char *foundry=0) |
Gets a font. More... | |
IlvFont * | getFont (const char *fontName) |
Gets a font. More... | |
IlvDim * | getFontSizes (const char *fontFamily, IlvFontStyle fontStyle, int &count, const char *foundry=0) const |
Gets font sizes. More... | |
Friends | |
class | IlvDisplay |
class | IlvFont |
Font manager class.
This class handles the fonts of an IlvDisplay
. IlvFontManager provide IlvFont
font objects. It informs about font sizes, font availability
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)
.
"boldfont"
display resource. IlvFont* IlvFontManager::defaultFont | ( | ) | const |
Gets the default font.
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)
.
"italicfont"
display resource. 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.
"largefont"
display resource. IlvFont* IlvFontManager::defaultNormalFont | ( | ) | const |
Gets the default normal font.
This font can also be retrieved using getFont("normal")
.
"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)
.
const char* const* IlvFontManager::getFamilyNames | ( | IlUShort & | count | ) | const |
Gets font family names.
count | The length of the returned array. |
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.
fontFamily | The name of the font family. |
fontSize | The size of the font. |
fontStyle | The style of the font. |
foundry | The font foundry. |
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.
fontName | The 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. |
0
if such a font cannot be created. 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.
fontFamily | The name of the font family. |
fontStyle | The style of the font. |
count | The length of the return array. |
foundry | The font foundry. |