]> git.lizzy.rs Git - minetest.git/blobdiff - src/cguittfont/CGUITTFont.h
Add colored text (not only colored chat).
[minetest.git] / src / cguittfont / CGUITTFont.h
index 12e25e0f3fa3c9983ab96619d3bd3f0c95eedac0..0aa540c5cfce7bf8b1ec5f69965fdccae7ef5cde 100644 (file)
@@ -1,6 +1,7 @@
 /*
    CGUITTFont FreeType class for Irrlicht
    Copyright (c) 2009-2010 John Norman
+   Copyright (c) 2016 NathanaĆ«l Courant
 
    This software is provided 'as-is', without any express or implied
    warranty. In no event will the authors be held liable for any
@@ -33,6 +34,8 @@
 
 #include <irrlicht.h>
 #include <ft2build.h>
+#include <vector>
+#include "util/enriched_string.h"
 #include FT_FREETYPE_H
 
 namespace irr
@@ -207,7 +210,7 @@ namespace gui
                        //! \param antialias set the use_monochrome (opposite to antialias) flag
                        //! \param transparency set the use_transparency flag
                        //! \return Returns a pointer to a CGUITTFont.  Will return 0 if the font failed to load.
-                       static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true);
+                       static CGUITTFont* createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true, const u32 shadow = 0, const u32 shadow_alpha = 255);
                        static CGUITTFont* createTTFont(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true);
                        static CGUITTFont* create(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true);
                        static CGUITTFont* create(IrrlichtDevice *device, const io::path& filename, const u32 size, const bool antialias = true, const bool transparency = true);
@@ -258,6 +261,10 @@ namespace gui
                        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);
+                       
+                       virtual void draw(const EnrichedString& text, const core::rect<s32>& position,
+                               video::SColor color, bool hcenter=false, bool vcenter=false,
+                               const core::rect<s32>* clip=0);
 
                        //! Returns the dimension of a character produced by this font.
                        virtual core::dimension2d<u32> getCharDimension(const wchar_t ch) const;
@@ -369,6 +376,8 @@ namespace gui
                        s32 GlobalKerningWidth;
                        s32 GlobalKerningHeight;
                        core::ustring Invisible;
+                       u32 shadow_offset;
+                       u32 shadow_alpha;
        };
 
 } // end namespace gui