19#ifndef HEADER_SCALABLE_FONT_HPP
20#define HEADER_SCALABLE_FONT_HPP
22#include "utils/leak_check.hpp"
24#include <IGUIFontBitmap.h>
48 FontSettings* getFontSettings() {
return m_font_settings; }
50 const FontSettings* getFontSettings()
const {
return m_font_settings; }
52 virtual void setScale(
float scale);
54 virtual float getScale()
const;
56 void setShadow(
const irr::video::SColor &col);
60 void setBlackBorder(
bool enabled);
62 void setColoredBorder(
const irr::video::SColor &col);
64 void setThinBorder(
bool thin);
66 void disableColoredBorder();
68 void draw(
const core::stringw& text,
const core::rect<s32>& position,
69 const video::SColor& color,
bool hcenter,
70 bool vcenter,
const core::rect<s32>* clip,
74 virtual void draw(
const core::stringw& text,
75 const core::rect<s32>& position,
76 video::SColor color,
bool hcenter =
false,
77 bool vcenter =
false,
const core::rect<s32>* clip = 0);
79 virtual void drawQuick(
const core::stringw& text,
80 const core::rect<s32>& position,
81 video::SColor color,
bool hcenter =
false,
83 const core::rect<s32>* clip = 0);
85 virtual void draw(
const std::vector<GlyphLayout>& gls,
86 const core::rect<s32>& position,
87 video::SColor color,
bool hcenter =
false,
88 bool vcenter =
false,
const core::rect<s32>* clip = 0);
91 std::vector<GlyphLayout>& gls,
95 virtual core::dimension2d<u32>
getDimension(
const wchar_t* text)
const;
97 virtual s32 getHeightPerLine()
const;
104 virtual EGUI_FONT_TYPE
getType()
const {
return EGFT_BITMAP; }
116 virtual void setKerningHeight (s32 kerning) {}
120 const wchar_t* previousLetter=0)
const
123 virtual s32 getKerningHeight()
const {
return 0; }
125 virtual void setInvisibleCharacters(
const wchar_t *s ) {}
127 virtual f32 getInverseShaping()
const;
129 virtual s32 getFaceFontMaxHeight()
const;
131 virtual s32 getFaceGlyphMaxHeight()
const;
This class stores settings when rendering fonts, used when instantiating irr::gui::ScalableFont.
Definition: font_settings.hpp:33
An abstract class which contains functions which convert vector fonts into bitmap and render them in ...
Definition: font_with_face.hpp:72
Definition: scalable_font.hpp:35
virtual void setKerningWidth(s32 kerning)
set an Pixel Offset on Drawing ( scale position on width )
Definition: scalable_font.hpp:114
virtual core::dimension2d< u32 > getDimension(const wchar_t *text) const
returns the dimension of a text
Definition: scalable_font.cpp:93
virtual u32 getSpriteNoFromChar(const wchar_t *c) const
returns the sprite number from a given character, unused in STK
Definition: scalable_font.hpp:110
virtual s32 getCharacterFromPos(const wchar_t *text, s32 pixel_x) const
Calculates the index of the character in the text which is on a specific position.
Definition: scalable_font.cpp:139
virtual s32 getKerningWidth(const wchar_t *thisLetter=0, const wchar_t *previousLetter=0) const
set an Pixel Offset on Drawing ( scale position on width )
Definition: scalable_font.hpp:119
virtual void initGlyphLayouts(const core::stringw &text, std::vector< GlyphLayout > &gls, u32 shape_flag=0)
Convert text to glyph layouts for fast rendering with optional caching enabled.
Definition: scalable_font.cpp:160
virtual EGUI_FONT_TYPE getType() const
Returns the type of this font.
Definition: scalable_font.hpp:104
virtual IGUISpriteBank * getSpriteBank() const
gets the sprite bank
Definition: scalable_font.cpp:145