rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvFont Class Reference

Resource class. More...

#include <ilviews/base/resource.h>

Inheritance diagram for IlvFont:
IlvResource

List of all members.

Public Member Functions

IlvDim ascent () const
 Gets the ascent value.
IlvDim descent () const
 Gets the descent value.
const char * getFamily () const
 Gets the font family name.
const char * getFoundry () const
 Gets the font foundry.
IlvFontSize getSize () const
 Gets the font size.
IlvFontStyle getStyle () const
 Gets the font style.
IlvDim height () const
 Gets the height.
IlBoolean isFixed () const
 Tells you if it is a fixed-width font.
IlvDim maxWidth () const
 Gets the maximum character width of a font.
IlvDim minWidth () const
 Gets the minimum character width of a font.
virtual void setName (const char *name)
 Sets the name of the resource.
void sizes (const char *string, int length, IlvDim &w, IlvDim &h, IlvDim &d) const
 Gets font dimensions of a string.
IlvDim stringHeight (const char *, int length=-1) const
 Gets the logical height of a string.
IlvDim stringWidth (const char *string, int length=-1) const
 Gets the logical width of a string.

Friends

class IlvDisplay

Detailed Description

Resource class.

Library: display

The IlvFont class defines a font that is used to draw strings with specific spacing values as in the following illustration:

font.gif


- Font -

See also:
IlvDisplay::defaultFont, IlvDisplay::getFont, IlvDisplay::getFontSizes.

Member Function Documentation

IlvDim IlvFont::ascent (  )  const

Gets the ascent value.

Retrieves the ascent spacing value of a given IlvFont object. Refer to the figure "Font" for an illustration.

Returns:
The font's ascent value.
IlvDim IlvFont::descent (  )  const

Gets the descent value.

Retrieves the descent spacing value of a given IlvFont object. Refer to the figure "Font" for an illustration. You can also get this quantity for a specific string by calling the member function sizes.

Returns:
The font's descent value.
const char* IlvFont::getFamily (  )  const

Gets the font family name.

Retrieves the font family of a given IlvFont object.

Returns:
The font family name.
const char* IlvFont::getFoundry (  )  const

Gets the font foundry.

Retrieves the font foundry of a given IlvFont object.

Returns:
The font foundry.
IlvFontSize IlvFont::getSize (  )  const

Gets the font size.

Retrieves the font size of a given IlvFont object.

Returns:
The font size.
IlvFontStyle IlvFont::getStyle (  )  const

Gets the font style.

Retrieves the font style of a given IlvFont object.

Returns:
The font style.
IlvDim IlvFont::height (  )  const

Gets the height.

Retrieves the height spacing value of a given IlvFont object. You can also get this quantity for a specific string by calling the member functions stringHeight or sizes of the IlvFont class.

Returns:
The font's height.
IlBoolean IlvFont::isFixed (  )  const

Tells you if it is a fixed-width font.

Returns:
IlTrue if this font object has a fixed width for all characters.
IlvDim IlvFont::maxWidth (  )  const

Gets the maximum character width of a font.

Returns:
The width of the widest characters of the font.
IlvDim IlvFont::minWidth (  )  const

Gets the minimum character width of a font.

Note that when both maxWidth and minWidth return the same value, then isFixed returns IlTrue.

Returns:
The width of the narrowest characters of the font.
virtual void IlvFont::setName ( const char *  name  )  [virtual]

Sets the name of the resource.

Names your resource by means of a unique name string descriptor that is internally copied.

Reimplemented from IlvResource.

void IlvFont::sizes ( const char *  string,
int  length,
IlvDim w,
IlvDim h,
IlvDim d 
) const

Gets font dimensions of a string.

This method returns logical dimensions. It does not return the precise painted rectangle but the dimensions of a box that provides minimum spacing to other graphical effects (such as a border surrounding the text). In other words, it is different from the bounding box of the ink used to draw the text.

Parameters:
string The string to be measured.
length The length of the string, in bytes. If a negative value is provided, the length is computed using strlen.
w Used to return the width of the string, in pixels.
h Used to return the height of the string, in pixels.
d Used to return the descent of the string, in pixels.
See also:
IlvFont::stringHeight, IlvFont::stringWidth
IlvDim IlvFont::stringHeight ( const char *  ,
int  length = -1 
) const

Gets the logical height of a string.

Just like IlvFont::sizes, this method returns a logical dimension. It does not return the precise height of the painted rectangle but the height of a box that provides minimum spacing to other graphical effects (such as a border surrounding the text). In other words, it is different from the height of the ink used to draw the text.

Parameters:
string The string to be measured.
length The length of the string, in bytes. If a negative value is provided, the length is computed using strlen.
Returns:
The logical height of the string, in pixels, when displayed with this font.
See also:
IlvFont::sizes, IlvFont::stringWidth
IlvDim IlvFont::stringWidth ( const char *  string,
int  length = -1 
) const

Gets the logical width of a string.

Just like IlvFont::sizes, this method returns a logical dimension. It does not return the precise width of the painted rectangle but the width of a box that provides minimum spacing to other graphical effects (such as a border surrounding the text). In other words, it is different from the width of the ink used to draw the text.

Parameters:
string The string to be measured.
length The length of the string, in bytes. If a negative value is provided, the length is computed using strlen.
Returns:
The logical width of the string, in pixels, when displayed with this font.
See also:
IlvFont::sizes, IlvFont::stringHeight
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.