X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Firrlicht_changes%2FCGUITTFont.h;h=7b04ae8280f8054669bf228b44e00d48b95bcf2e;hb=f2fd4432625ee5cf0380bdd006cd1f15d053b12f;hp=7ce89836979ade887f78b72f679f4eb190668d48;hpb=16938adfc00b3c56a7b08a9eb97160b68902bae6;p=dragonfireclient.git diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h index 7ce898369..7b04ae828 100644 --- a/src/irrlicht_changes/CGUITTFont.h +++ b/src/irrlicht_changes/CGUITTFont.h @@ -29,13 +29,12 @@ john@suckerfreegames.com */ -#ifndef __C_GUI_TTFONT_H_INCLUDED__ -#define __C_GUI_TTFONT_H_INCLUDED__ +#pragma once #include #include #include -#include "irrUString.h" +#include #include "util/enriched_string.h" #include FT_FREETYPE_H @@ -200,6 +199,7 @@ namespace gui core::array render_positions; core::array render_source_rects; + core::array render_colors; private: core::array glyph_to_be_paged; @@ -270,8 +270,8 @@ namespace gui video::SColor color, bool hcenter=false, bool vcenter=false, const core::rect* clip=0); - virtual void draw(const EnrichedString& text, const core::rect& position, - video::SColor color, bool hcenter=false, bool vcenter=false, + void draw(const EnrichedString& text, const core::rect& position, + bool hcenter=false, bool vcenter=false, const core::rect* clip=0); //! Returns the dimension of a character produced by this font. @@ -314,6 +314,9 @@ namespace gui //! Get the last glyph page's index. u32 getLastGlyphPageIndex() const { return Glyph_Pages.size() - 1; } + //! Set font that should be used for glyphs not present in ours + void setFallback(gui::IGUIFont* font) { fallback = font; } + //! Create corresponding character's software image copy from the font, //! so you can use this data just like any ordinary video::IImage. //! \param ch The character you need @@ -328,6 +331,8 @@ namespace gui (const wchar_t* text, scene::ISceneManager* smgr, scene::ISceneNode* parent = 0, const video::SColor& color = video::SColor(255, 0, 0, 0), bool center = false ); + inline s32 getAscender() const { return font_metrics.ascender; } + protected: bool use_monochrome; bool use_transparency; @@ -355,7 +360,7 @@ namespace gui load_flags = FT_LOAD_DEFAULT | FT_LOAD_RENDER; if (!useHinting()) load_flags |= FT_LOAD_NO_HINTING; if (!useAutoHinting()) load_flags |= FT_LOAD_NO_AUTOHINT; - if (useMonochrome()) load_flags |= FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO | FT_RENDER_MODE_MONO; + if (useMonochrome()) load_flags |= FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO; else load_flags |= FT_LOAD_TARGET_NORMAL; } u32 getWidthFromCharacter(wchar_t c) const; @@ -386,9 +391,9 @@ namespace gui core::ustring Invisible; u32 shadow_offset; u32 shadow_alpha; + + gui::IGUIFont* fallback; }; } // end namespace gui } // end namespace irr - -#endif // __C_GUI_TTFONT_H_INCLUDED__