arsa  2.7
Public Member Functions | List of all members
irr::gui::IGUIFont Class Referenceabstract

Font interface. More...

#include <IGUIFont.h>

Inheritance diagram for irr::gui::IGUIFont:
irr::IReferenceCounted irr::gui::IGUIFontBitmap

Public Member Functions

virtual void draw (const core::stringw &text, const core::rect< s32 > &position, video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect< s32 > *clip=0)=0
 Draws some text and clips it to the specified rectangle if wanted. More...
 
virtual core::dimension2d< u32getDimension (const wchar_t *text) const =0
 Calculates the width and height of a given string of text. More...
 
virtual s32 getCharacterFromPos (const wchar_t *text, s32 pixel_x) const =0
 Calculates the index of the character in the text which is on a specific position. More...
 
virtual EGUI_FONT_TYPE getType () const
 Returns the type of this font. More...
 
virtual void setKerningWidth (s32 kerning)=0
 Sets global kerning width for the font. More...
 
virtual void setKerningHeight (s32 kerning)=0
 Sets global kerning height for the font. More...
 
virtual s32 getKerningWidth (const wchar_t *thisLetter=0, const wchar_t *previousLetter=0) const =0
 Gets kerning values (distance between letters) for the font. If no parameters are provided,. More...
 
virtual s32 getKerningHeight () const =0
 Returns the distance between letters. More...
 
virtual void setInvisibleCharacters (const wchar_t *s)=0
 Define which characters should not be drawn by the font. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

Font interface.

Definition at line 39 of file IGUIFont.h.

Member Function Documentation

◆ draw()

virtual void irr::gui::IGUIFont::draw ( const core::stringw text,
const core::rect< s32 > &  position,
video::SColor  color,
bool  hcenter = false,
bool  vcenter = false,
const core::rect< s32 > *  clip = 0 
)
pure virtual

Draws some text and clips it to the specified rectangle if wanted.

Parameters
textText to draw
positionRectangle specifying position where to draw the text.
colorColor of the text
hcenterSpecifies if the text should be centered horizontally into the rectangle.
vcenterSpecifies if the text should be centered vertically into the rectangle.
clipOptional pointer to a rectangle against which the text will be clipped. If the pointer is null, no clipping will be done.

◆ getCharacterFromPos()

virtual s32 irr::gui::IGUIFont::getCharacterFromPos ( const wchar_t *  text,
s32  pixel_x 
) const
pure virtual

Calculates the index of the character in the text which is on a specific position.

Parameters
textText string.
pixel_xX pixel position of which the index of the character will be returned.
Returns
Returns zero based index of the character in the text, and -1 if no no character is on this position. (=the text is too short).

◆ getDimension()

virtual core::dimension2d<u32> irr::gui::IGUIFont::getDimension ( const wchar_t *  text) const
pure virtual

Calculates the width and height of a given string of text.

Returns
Returns width and height of the area covered by the text if it would be drawn.

◆ getKerningHeight()

virtual s32 irr::gui::IGUIFont::getKerningHeight ( ) const
pure virtual

Returns the distance between letters.

◆ getKerningWidth()

virtual s32 irr::gui::IGUIFont::getKerningWidth ( const wchar_t *  thisLetter = 0,
const wchar_t *  previousLetter = 0 
) const
pure virtual

Gets kerning values (distance between letters) for the font. If no parameters are provided,.

the global kerning distance is returned.

Parameters
thisLetterIf this parameter is provided, the left side kerning for this letter is added to the global kerning value. For example, a space might only be one pixel wide, but it may be displayed as several pixels.
previousLetterIf provided, kerning is calculated for both letters and added to the global kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have the 'o' tucked neatly under the 'W'.

Implemented in irr::gui::IGUIFontBitmap.

◆ getType()

virtual EGUI_FONT_TYPE irr::gui::IGUIFont::getType ( ) const
inlinevirtual

Returns the type of this font.

Reimplemented in irr::gui::IGUIFontBitmap.

Definition at line 68 of file IGUIFont.h.

68 { return EGFT_CUSTOM; }
An external font type provided by the user.
Definition: IGUIFont.h:35

◆ setInvisibleCharacters()

virtual void irr::gui::IGUIFont::setInvisibleCharacters ( const wchar_t *  s)
pure virtual

Define which characters should not be drawn by the font.

For example " " would not draw any space which is usually blank in most fonts.

Parameters
sString of symbols which are not send down to the videodriver

◆ setKerningHeight()

virtual void irr::gui::IGUIFont::setKerningHeight ( s32  kerning)
pure virtual

Sets global kerning height for the font.

◆ setKerningWidth()

virtual void irr::gui::IGUIFont::setKerningWidth ( s32  kerning)
pure virtual

Sets global kerning width for the font.


The documentation for this class was generated from the following file: