Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
IGUIFont.hpp
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in nirtcpp/nirtcpp.hpp
4
5#ifndef NIRT_I_GUI_FONT_HPP_INCLUDED
6#define NIRT_I_GUI_FONT_HPP_INCLUDED
7
8#include <nirtcpp/core/engine/IReferenceCounted.hpp>
9#include <nirtcpp/core/engine/SColor.hpp>
10#include <nirtcpp/core/engine/rect.hpp>
11#include <nirtcpp/core/engine/irrString.hpp>
12
13namespace nirt
14{
15namespace gui
16{
17
37
39class IGUIFont : public virtual IReferenceCounted
40{
41public:
42
44
51 virtual void draw(const core::stringw& text, const core::rect<s32>& position,
52 video::SColor color, bool hcenter=false, bool vcenter=false,
53 const core::rect<s32>* clip=0) = 0;
54
56
58 virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0;
59
61
65 virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const = 0;
66
68 virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; }
69
71 virtual void setKerningWidth (s32 kerning) = 0;
72
74 virtual void setKerningHeight (s32 kerning) = 0;
75
77
87 virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0;
88
90 virtual s32 getKerningHeight() const = 0;
91
93
97 virtual void setInvisibleCharacters( const wchar_t *s ) = 0;
98};
99
100} // end namespace gui
101} // end namespace nirt
102
103#endif
Base class of most objects of the Nirtcpp Engine.
Definition IReferenceCounted.hpp:46
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.hpp:22
Very simple string class with some useful features.
Definition irrString.hpp:94
Font interface.
Definition IGUIFont.hpp:40
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.
virtual void setKerningWidth(s32 kerning)=0
Sets global kerning width for the font.
virtual core::dimension2d< u32 > getDimension(const wchar_t *text) const =0
Calculates the width and height of a given string of text.
virtual EGUI_FONT_TYPE getType() const
Returns the type of this font.
Definition IGUIFont.hpp:68
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,...
virtual void setKerningHeight(s32 kerning)=0
Sets global kerning height for the font.
virtual s32 getKerningHeight() const =0
Returns the distance between letters.
virtual void setInvisibleCharacters(const wchar_t *s)=0
Define which characters should not be drawn by the font.
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.
Class representing a 32 bit ARGB color.
Definition SColor.hpp:317
EGUI_FONT_TYPE
An enum for the different types of GUI font.
Definition IGUIFont.hpp:20
@ EGFT_OS
A font which uses a the native API provided by the operating system.
Definition IGUIFont.hpp:32
@ EGFT_BITMAP
Bitmap fonts loaded from an XML file or a texture.
Definition IGUIFont.hpp:22
@ EGFT_CUSTOM
An external font type provided by the user.
Definition IGUIFont.hpp:35
@ EGFT_VECTOR
Scalable vector fonts loaded from an XML file.
Definition IGUIFont.hpp:28
As of Nirtcpp 1.6, position2d is a synonym for vector2d.
Definition vector3d.hpp:11
signed int s32
32 bit signed variable.
Definition irrTypes.hpp:72

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print