Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Resource class. More...
#include <ilviews/base/resource.h>
Public Member Functions | |
IlvDim | ascent () const |
Gets the ascent value. More... | |
IlvDim | descent () const |
Gets the descent value. More... | |
const char * | getFamily () const |
Gets the font family name. More... | |
const char * | getFoundry () const |
Gets the font foundry. More... | |
IlvFontSize | getSize () const |
Gets the font size. More... | |
IlvFontStyle | getStyle () const |
Gets the font style. More... | |
IlvDim | height () const |
Gets the height. More... | |
IlBoolean | isFixed () const |
Tells you if it is a fixed-width font. More... | |
IlvDim | maxWidth () const |
Gets the maximum character width of a font. More... | |
IlvDim | minWidth () const |
Gets the minimum character width of a font. More... | |
virtual void | setName (const char *name) |
Sets the name of the resource. More... | |
void | sizes (const char *string, int length, IlvDim &w, IlvDim &h, IlvDim &d) const |
Gets font dimensions of a string. More... | |
IlvDim | stringHeight (const char *string, int length=-1) const |
Gets the logical height of a string. More... | |
IlvDim | stringWidth (const char *string, int length=-1) const |
Gets the logical width of a string. More... | |
Public Member Functions inherited from IlvResource | |
IlvDisplay * | getDisplay () const |
Gets the IlvDisplay instance. More... | |
const char * | getName () const |
Gets the resource name. More... | |
void | lock () |
Locks the resource. More... | |
virtual void | unLock () |
Unlocks the resource. More... | |
Friends | |
class | IlvDisplay |
class | IlvSystemPort |
Resource class.
Library: xviews or winviews or mviews (mutually exclusive)
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 |
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. |
IlvDim IlvFont::stringHeight | ( | const char * | string, |
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 2016, 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.