5#include <unordered_map>
175 static constexpr const char*
TypeName =
"IFontObject";
230 virtual void create(
const sol::table& config) = 0;
237 virtual bool getGlyphMetrics(Uint32 ch,
int *minx,
int *maxx,
int *miny,
int *maxy,
int *advance)
const = 0;
259 const std::string& fontResourceName,
Definition SDOM_Factory.hpp:43
Definition SDOM_IAssetObject.hpp:10
IAssetObject()
Definition SDOM_IAssetObject.cpp:29
Definition SDOM_IFontObject.hpp:170
virtual int getFontSize()=0
virtual void drawPhraseOutline(const std::string &str, int x, int y, const FontStyle &style)=0
int getWordWidth(const std::string &word) const
Definition SDOM_IFontObject.cpp:78
friend Core
Definition SDOM_IFontObject.hpp:266
int getWordHeight(const std::string &word) const
Definition SDOM_IFontObject.cpp:89
virtual void drawPhrase(const std::string &str, int x, int y, const FontStyle &style)=0
virtual ~IFontObject() override
Definition SDOM_IFontObject.cpp:72
FontType
Definition SDOM_IFontObject.hpp:177
static std::unordered_map< FontType, std::string > FontTypeToString
Definition SDOM_IFontObject.hpp:178
virtual void setFontStyle(const FontStyle &style)=0
static std::unordered_map< std::string, FontType > StringToFontType
Definition SDOM_IFontObject.hpp:182
virtual int getFontAscent()=0
static constexpr const char * TypeName
Definition SDOM_IFontObject.hpp:175
virtual void drawGlyph(Uint32 ch, int x, int y, const FontStyle &style)=0
FontType fontType_
Definition SDOM_IFontObject.hpp:269
virtual int getGlyphHeight(Uint32 ch) const =0
virtual bool getGlyphMetrics(Uint32 ch, int *minx, int *maxx, int *miny, int *maxy, int *advance) const =0
friend Factory
Definition SDOM_IFontObject.hpp:265
virtual void setFontSize(int p_size)=0
int fontSize_
Definition SDOM_IFontObject.hpp:268
static void applyBitmapFontDefaults(class Factory &factory, const std::string &fontResourceName, int &outFontSize, int &outFontWidth, int &outFontHeight)
Definition SDOM_IFontObject.cpp:143
virtual FontStyle getFontStyle()=0
int getFontSize() const
Definition SDOM_IFontObject.hpp:249
virtual void onUnload()=0
virtual void create(const sol::table &config)=0
virtual int getGlyphWidth(Uint32 ch) const =0
FontType getFontType() const
Definition SDOM_IFontObject.hpp:250
virtual void drawPhraseDropshadow(const std::string &str, int x, int y, const FontStyle &style)=0
virtual void _registerLuaBindings(const std::string &typeName, sol::state_view lua)
Definition SDOM_IFontObject.cpp:99
Contains all core classes and utilities for the SDOM library.
Definition lua_BindHelpers.hpp:7
LabelAlign
Definition SDOM_IFontObject.hpp:14
bool operator!=(const SDOM::FontStyle &a, const SDOM::FontStyle &b)
Definition SDOM_IFontObject.hpp:75
constexpr int maxOutlineThickness
Definition SDOM_IFontObject.hpp:10
@ MIDDLE_RIGHT
Middle-right edge of the parent.
@ BOTTOM
Alias for BOTTOM_CENTER.
@ RIGHT
Alias for MIDDLE_RIGHT.
@ BOTTOM_RIGHT
Bottom-right corner of the parent.
@ BOTTOM_CENTER
Bottom-center edge of the parent.
@ MIDDLE
Alias for MIDDLE_CENTER.
@ DEFAULT
Default anchor point (same as TOP_LEFT)
@ TOP
Alias for TOP_CENTER.
@ LEFT
Alias for MIDDLE_LEFT.
@ TOP_LEFT
Top-left corner of the parent.
@ MIDDLE_CENTER
Center of the parent.
@ BOTTOM_LEFT
Bottom-left corner of the parent.
@ TOP_RIGHT
Top-right corner of the parent.
@ MIDDLE_LEFT
Middle-left edge of the parent.
@ CENTER
Alias for MIDDLE_CENTER.
@ TOP_CENTER
Top-center edge of the parent.
bool operator==(const IAssetObject &a, const IAssetObject &b)
Definition SDOM_IAssetObject.hpp:66
Definition SDOM_IFontObject.hpp:35
bool bold
Definition SDOM_IFontObject.hpp:36
int maxWidth
Definition SDOM_IFontObject.hpp:55
bool strikethrough
Definition SDOM_IFontObject.hpp:39
bool wordwrap
Definition SDOM_IFontObject.hpp:53
bool border
Definition SDOM_IFontObject.hpp:40
int padding_horiz
Definition SDOM_IFontObject.hpp:60
SDL_Color outlineColor
Definition SDOM_IFontObject.hpp:70
int padding_vert
Definition SDOM_IFontObject.hpp:61
bool dropshadow
Definition SDOM_IFontObject.hpp:43
int borderThickness
Definition SDOM_IFontObject.hpp:58
SDL_Color borderColor
Definition SDOM_IFontObject.hpp:69
SDL_Color foregroundColor
Definition SDOM_IFontObject.hpp:67
SDL_Color backgroundColor
Definition SDOM_IFontObject.hpp:68
int fontSize
Definition SDOM_IFontObject.hpp:45
int fontHeight
Definition SDOM_IFontObject.hpp:51
SDL_Color dropshadowColor
Definition SDOM_IFontObject.hpp:71
int dropshadowOffsetY
Definition SDOM_IFontObject.hpp:63
int outlineThickness
Definition SDOM_IFontObject.hpp:59
bool auto_resize
Definition SDOM_IFontObject.hpp:54
bool underline
Definition SDOM_IFontObject.hpp:38
bool italic
Definition SDOM_IFontObject.hpp:37
LabelAlign alignment
Definition SDOM_IFontObject.hpp:65
bool outline
Definition SDOM_IFontObject.hpp:42
int dropshadowOffsetX
Definition SDOM_IFontObject.hpp:62
bool background
Definition SDOM_IFontObject.hpp:41
int maxHeight
Definition SDOM_IFontObject.hpp:56
int fontWidth
Definition SDOM_IFontObject.hpp:50
Definition SDOM_IAssetObject.hpp:18
std::string name
Definition SDOM_IAssetObject.hpp:19
std::string type
Definition SDOM_IAssetObject.hpp:20
std::string filename
Definition SDOM_IAssetObject.hpp:21
Definition SDOM_IFontObject.hpp:192
InitStruct()
Definition SDOM_IFontObject.hpp:193
int fontSize_
Definition SDOM_IFontObject.hpp:199