34#ifndef NOMLIB_SDL2_BITMAP_FONT_HEADERS
35#define NOMLIB_SDL2_BITMAP_FONT_HEADERS
42#include "nomlib/config.hpp"
43#include "nomlib/math/Color4.hpp"
44#include "nomlib/graphics/fonts/IFont.hpp"
45#include "nomlib/graphics/fonts/FontMetrics.hpp"
46#include "nomlib/graphics/fonts/FontPage.hpp"
60 typedef self_type* RawPtr;
61 typedef std::shared_ptr<self_type> SharedPtr;
73 IFont::raw_ptr
clone(
void )
const override;
76 bool valid (
void )
const override;
78 enum IFont::FontType type (
void )
const override;
80 const Image* image(uint32 character_size)
const override;
86 sint
spacing ( uint32 character_size )
const override;
93 int newline( uint32 character_size )
const override;
100 int kerning( uint32 first_char, uint32 second_char, uint32 character_size )
const override;
120 const Glyph&
glyph ( uint32 codepoint, uint32 character_size )
const override;
148 bool load(
const std::string& filename )
override;
160 bool build ( uint32 character_size );
162 const GlyphPage& pages (
void )
const;
164 sint sheet_width (
void )
const;
165 sint sheet_height (
void )
const;
sint spacing(uint32 character_size) const override
Obtain text character spacing width in pixels.
IFont::raw_ptr clone(void) const override
Construct a clone of the existing instance.
sint sheet_width_
Width – in pixels – of overall texture atlas sheet.
uint32 font_style(void) const override
Get the rendering style of the font.
int hinting(void) const override
Get the font's hinting style.
bool set_point_size(sint size) override
Set a new font point size.
const Glyph & glyph(uint32 codepoint, uint32 character_size) const override
Obtain a glyph.
sint sheet_height_
Height – in pixels – of overall texture atlas sheet.
int kerning(uint32 first_char, uint32 second_char, uint32 character_size) const override
Obtain the kerning pair offsets between two glyphs.
void set_font_style(uint32 style) override
Set the rendering style of the font.
enum IFont::FontType type_
The type of font we are.
bool set_hinting(int type) override
Set the requested font hinting style.
BitmapFont(void)
Default constructor.
const FontMetrics & metrics(void) const override
Obtain information about the loaded font.
Color4i color_mask_
The pixel color found at the texture atlas position 0, 0 is used as a color mask – to filter out non-...
void set_font_kerning(bool state) override
Set the use of kerning for the font.
bool load(const std::string &filename) override
Loads a new bitmap font from a file.
bool build(uint32 character_size)
~BitmapFont(void)
Destructor.
FontMetrics metrics_
General font metric data, such as the proper value for newline spacing.
BitmapFont(const BitmapFont ©)
Copy constructor.
bool valid(void) const override
Validity check.
bool set_outline(int) override
int newline(uint32 character_size) const override
Obtain font's line spacing.
Bitmap storage container.
Container structure for global font metric data.
Container structure for font data.