34 #ifndef NOMLIB_SDL2_BITMAP_FONT_HEADERS
35 #define NOMLIB_SDL2_BITMAP_FONT_HEADERS
41 #include "nomlib/config.hpp"
42 #include "nomlib/graphics/IFont.hpp"
43 #include "nomlib/math/Coords.hpp"
44 #include "nomlib/math/Rect-inl.hpp"
45 #include "nomlib/math/Color.hpp"
46 #include "nomlib/graphics/Texture.hpp"
47 #include "nomlib/SDL_helpers.hpp"
63 IFont::SharedPtr
clone (
void )
const;
66 const std::string&
getText (
void )
const;
69 void setText (
const std::string& text );
88 const Color& getColor (
void )
const;
89 const Coords& getPosition (
void )
const;
105 IFont::TextAlignment getTextJustification (
void )
const;
127 const Coords findGlyph (
const std::string& glyph );
133 const std::string& filename,
const Color& colorkey,
134 bool use_cache =
false
147 bool resize (
enum ResizeAlgorithm scaling_algorithm );
185 enum IFont::TextAlignment text_alignment;
200 #endif // include guard defined
uint32 getNewline(void) const
~BitmapFont(void)
Default destructor.
std::string text_buffer
holds contents of text as a string
BitmapFont(void)
Default constructor.
uint32 getSpacing(void) const
void setTextJustification(IFont::TextAlignment alignment)
Color color
Not implemented (yet)
RenderStyle
Text rendering qualities.
enum IFont::FontStyle text_style
Current text effect set.
void setText(const std::string &text)
Set a new text string for drawing; defaults to \0.
Coords chars[256]
individual chars positioning offsets within bitmap_font
void setColor(const Color &color)
Not implemented.
Texture bitmap_font
pointer reference holding our bitmap font image sheet
const std::string & getText(void) const
Obtains set text string buffer; defaults to \0.
IFont::SharedPtr clone(void) const
Return a std::shared_ptr copy of this instance.
Coords coords
Positioning coordinates.
FontStyle
Text effect styling.
int32 getFontHeight(void) const
void draw(RenderTarget target) const
Coordinate values (x, y, z, width, height ) wrapper.
bool resize(enum ResizeAlgorithm scaling_algorithm)
void setSpacing(uint32 spaces)
uint32 newline
height (in pixels) to offset when newline carriage char is encountered
void setNewline(uint32_t newline)
Set new text character spacing height offsets in pixels.
int32 getFontWidth(void) const
bool load(const std::string &filename, const Color &colorkey, bool use_cache=false)
void setFontStyle(int32 style, uint8 options=150)
Utility class container for RGBA colors.