diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IGUIFont.h | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/libraries/irrlicht-1.8/include/IGUIFont.h b/libraries/irrlicht-1.8/include/IGUIFont.h index 4746c81..2e97c82 100644 --- a/libraries/irrlicht-1.8/include/IGUIFont.h +++ b/libraries/irrlicht-1.8/include/IGUIFont.h | |||
@@ -1,104 +1,104 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __I_GUI_FONT_H_INCLUDED__ | 5 | #ifndef __I_GUI_FONT_H_INCLUDED__ |
6 | #define __I_GUI_FONT_H_INCLUDED__ | 6 | #define __I_GUI_FONT_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IReferenceCounted.h" | 8 | #include "IReferenceCounted.h" |
9 | #include "SColor.h" | 9 | #include "SColor.h" |
10 | #include "rect.h" | 10 | #include "rect.h" |
11 | #include "irrString.h" | 11 | #include "irrString.h" |
12 | 12 | ||
13 | namespace irr | 13 | namespace irr |
14 | { | 14 | { |
15 | namespace gui | 15 | namespace gui |
16 | { | 16 | { |
17 | 17 | ||
18 | //! An enum for the different types of GUI font. | 18 | //! An enum for the different types of GUI font. |
19 | enum EGUI_FONT_TYPE | 19 | enum EGUI_FONT_TYPE |
20 | { | 20 | { |
21 | //! Bitmap fonts loaded from an XML file or a texture. | 21 | //! Bitmap fonts loaded from an XML file or a texture. |
22 | EGFT_BITMAP = 0, | 22 | EGFT_BITMAP = 0, |
23 | 23 | ||
24 | //! Scalable vector fonts loaded from an XML file. | 24 | //! Scalable vector fonts loaded from an XML file. |
25 | /** These fonts reside in system memory and use no video memory | 25 | /** These fonts reside in system memory and use no video memory |
26 | until they are displayed. These are slower than bitmap fonts | 26 | until they are displayed. These are slower than bitmap fonts |
27 | but can be easily scaled and rotated. */ | 27 | but can be easily scaled and rotated. */ |
28 | EGFT_VECTOR, | 28 | EGFT_VECTOR, |
29 | 29 | ||
30 | //! A font which uses a the native API provided by the operating system. | 30 | //! A font which uses a the native API provided by the operating system. |
31 | /** Currently not used. */ | 31 | /** Currently not used. */ |
32 | EGFT_OS, | 32 | EGFT_OS, |
33 | 33 | ||
34 | //! An external font type provided by the user. | 34 | //! An external font type provided by the user. |
35 | EGFT_CUSTOM | 35 | EGFT_CUSTOM |
36 | }; | 36 | }; |
37 | 37 | ||
38 | //! Font interface. | 38 | //! Font interface. |
39 | class IGUIFont : public virtual IReferenceCounted | 39 | class IGUIFont : public virtual IReferenceCounted |
40 | { | 40 | { |
41 | public: | 41 | public: |
42 | 42 | ||
43 | //! Draws some text and clips it to the specified rectangle if wanted. | 43 | //! Draws some text and clips it to the specified rectangle if wanted. |
44 | /** \param text: Text to draw | 44 | /** \param text: Text to draw |
45 | \param position: Rectangle specifying position where to draw the text. | 45 | \param position: Rectangle specifying position where to draw the text. |
46 | \param color: Color of the text | 46 | \param color: Color of the text |
47 | \param hcenter: Specifies if the text should be centered horizontally into the rectangle. | 47 | \param hcenter: Specifies if the text should be centered horizontally into the rectangle. |
48 | \param vcenter: Specifies if the text should be centered vertically into the rectangle. | 48 | \param vcenter: Specifies if the text should be centered vertically into the rectangle. |
49 | \param clip: Optional pointer to a rectangle against which the text will be clipped. | 49 | \param clip: Optional pointer to a rectangle against which the text will be clipped. |
50 | If the pointer is null, no clipping will be done. */ | 50 | If the pointer is null, no clipping will be done. */ |
51 | virtual void draw(const core::stringw& text, const core::rect<s32>& position, | 51 | virtual void draw(const core::stringw& text, const core::rect<s32>& position, |
52 | video::SColor color, bool hcenter=false, bool vcenter=false, | 52 | video::SColor color, bool hcenter=false, bool vcenter=false, |
53 | const core::rect<s32>* clip=0) = 0; | 53 | const core::rect<s32>* clip=0) = 0; |
54 | 54 | ||
55 | //! Calculates the width and height of a given string of text. | 55 | //! Calculates the width and height of a given string of text. |
56 | /** \return Returns width and height of the area covered by the text if | 56 | /** \return Returns width and height of the area covered by the text if |
57 | it would be drawn. */ | 57 | it would be drawn. */ |
58 | virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0; | 58 | virtual core::dimension2d<u32> getDimension(const wchar_t* text) const = 0; |
59 | 59 | ||
60 | //! Calculates the index of the character in the text which is on a specific position. | 60 | //! Calculates the index of the character in the text which is on a specific position. |
61 | /** \param text: Text string. | 61 | /** \param text: Text string. |
62 | \param pixel_x: X pixel position of which the index of the character will be returned. | 62 | \param pixel_x: X pixel position of which the index of the character will be returned. |
63 | \return Returns zero based index of the character in the text, and -1 if no no character | 63 | \return Returns zero based index of the character in the text, and -1 if no no character |
64 | is on this position. (=the text is too short). */ | 64 | is on this position. (=the text is too short). */ |
65 | virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const = 0; | 65 | virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const = 0; |
66 | 66 | ||
67 | //! Returns the type of this font | 67 | //! Returns the type of this font |
68 | virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; } | 68 | virtual EGUI_FONT_TYPE getType() const { return EGFT_CUSTOM; } |
69 | 69 | ||
70 | //! Sets global kerning width for the font. | 70 | //! Sets global kerning width for the font. |
71 | virtual void setKerningWidth (s32 kerning) = 0; | 71 | virtual void setKerningWidth (s32 kerning) = 0; |
72 | 72 | ||
73 | //! Sets global kerning height for the font. | 73 | //! Sets global kerning height for the font. |
74 | virtual void setKerningHeight (s32 kerning) = 0; | 74 | virtual void setKerningHeight (s32 kerning) = 0; |
75 | 75 | ||
76 | //! Gets kerning values (distance between letters) for the font. If no parameters are provided, | 76 | //! Gets kerning values (distance between letters) for the font. If no parameters are provided, |
77 | /** the global kerning distance is returned. | 77 | /** the global kerning distance is returned. |
78 | \param thisLetter: If this parameter is provided, the left side kerning | 78 | \param thisLetter: If this parameter is provided, the left side kerning |
79 | for this letter is added to the global kerning value. For example, a | 79 | for this letter is added to the global kerning value. For example, a |
80 | space might only be one pixel wide, but it may be displayed as several | 80 | space might only be one pixel wide, but it may be displayed as several |
81 | pixels. | 81 | pixels. |
82 | \param previousLetter: If provided, kerning is calculated for both | 82 | \param previousLetter: If provided, kerning is calculated for both |
83 | letters and added to the global kerning value. For example, in a font | 83 | letters and added to the global kerning value. For example, in a font |
84 | which supports kerning pairs a string such as 'Wo' may have the 'o' | 84 | which supports kerning pairs a string such as 'Wo' may have the 'o' |
85 | tucked neatly under the 'W'. | 85 | tucked neatly under the 'W'. |
86 | */ | 86 | */ |
87 | virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0; | 87 | virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0; |
88 | 88 | ||
89 | //! Returns the distance between letters | 89 | //! Returns the distance between letters |
90 | virtual s32 getKerningHeight() const = 0; | 90 | virtual s32 getKerningHeight() const = 0; |
91 | 91 | ||
92 | //! Define which characters should not be drawn by the font. | 92 | //! Define which characters should not be drawn by the font. |
93 | /** For example " " would not draw any space which is usually blank in | 93 | /** For example " " would not draw any space which is usually blank in |
94 | most fonts. | 94 | most fonts. |
95 | \param s String of symbols which are not send down to the videodriver | 95 | \param s String of symbols which are not send down to the videodriver |
96 | */ | 96 | */ |
97 | virtual void setInvisibleCharacters( const wchar_t *s ) = 0; | 97 | virtual void setInvisibleCharacters( const wchar_t *s ) = 0; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | } // end namespace gui | 100 | } // end namespace gui |
101 | } // end namespace irr | 101 | } // end namespace irr |
102 | 102 | ||
103 | #endif | 103 | #endif |
104 | 104 | ||