22 #ifndef FIFE_GUI_FONT_H 23 #define FIFE_GUI_FONT_H 28 #include <fifechan/font.hpp> 48 void drawString(fcn::Graphics* graphics,
const std::string& text, int32_t x, int32_t y);
49 void drawMultiLineString(fcn::Graphics* graphics,
const std::string& text, int32_t x, int32_t y);
50 std::string
splitTextToWidth (
const std::string& text, int32_t render_width);
72 int32_t
getWidth(
const std::string& text)
const;
std::string splitTextToWidth(const std::string &text, int32_t render_width)
bool isStrikethroughStyle() const
Checks if strikethrough style is used.
void setUnderlineStyle(bool style)
Sets the use of underline style.
void drawString(fcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
void setDynamicColoring(bool coloring)
GuiFont(IFont *font)
Constructor Takes the ownership of given font.
Image * getAsImage(const std::string &text)
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
void setBoldStyle(bool style)
Sets the use of bold style.
void drawMultiLineString(fcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y)
SDL_Color getColor() const
Get the color the text was rendered in.
void setRowSpacing(int32_t spacing)
Sets the spacing between rows in pixels.
Image * getAsImageMultiline(const std::string &text)
Gets given text as Image.
void setGlyphSpacing(int32_t spacing)
Sets the spacing between letters in pixels.
bool isAntiAlias() const
Checks if anti aliasing is used.
int32_t getStringIndexAt(const std::string &text, int32_t x) const
bool isUnderlineStyle() const
Checks if underline style is used.
Pure abstract Font interface.
int32_t getHeight() const
gets height of this font
void setAntiAlias(bool antiAlias)
Sets the use of anti aliasing.
bool isItalicStyle() const
Checks if italic style is used.
int32_t getWidth(const std::string &text) const
gets width of given text
int32_t getGlyphSpacing() const
Gets the spacing between letters in pixels.
int32_t getRowSpacing() const
Gets the spacing between rows in pixels.
void setItalicStyle(bool style)
Sets the use of italic style.
bool isDynamicColoring() const
void setStrikethroughStyle(bool style)
Sets the use of strikethrough style.
void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
Set the color the text should be rendered in.
bool isBoldStyle() const
Checks if bold style is used.