Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Resource class. More...
#include <ilviews/base/resource.h>
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 |
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 -
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.
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
.
const char* IlvFont::getFamily | ( | ) | const |
Gets the font family name.
Retrieves the font family of a given IlvFont
object.
const char* IlvFont::getFoundry | ( | ) | const |
Gets the font foundry.
Retrieves the font foundry of a given IlvFont
object.
IlvFontSize IlvFont::getSize | ( | ) | const |
IlvFontStyle IlvFont::getStyle | ( | ) | const |
IlvDim IlvFont::height | ( | ) | const |
IlBoolean IlvFont::isFixed | ( | ) | const |
Tells you if it is a fixed-width font.
IlTrue
if this font object has a fixed width for all characters. IlvDim IlvFont::maxWidth | ( | ) | const |
Gets the maximum character width of a 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
.
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.
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.
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. |
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.
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 . |
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.
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 . |
IlvFont::sizes
, IlvFont::stringHeight
© 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.