34#ifndef NOMLIB_SDL2_BITMAP_FONT_HEADERS
35#define NOMLIB_SDL2_BITMAP_FONT_HEADERS
41#include "nomlib/config.hpp"
42#include "nomlib/math/Color4.hpp"
43#include "nomlib/graphics/fonts/IFont.hpp"
44#include "nomlib/graphics/fonts/FontMetrics.hpp"
45#include "nomlib/graphics/fonts/FontPage.hpp"
59 typedef self_type* RawPtr;
60 typedef std::shared_ptr<self_type> SharedPtr;
72 IFont::raw_ptr
clone(
void )
const override;
75 bool valid (
void )
const override;
77 enum IFont::FontType type (
void )
const override;
79 const Image* image(uint32 character_size)
const override;
85 sint
spacing ( uint32 character_size )
const override;
92 int newline( uint32 character_size )
const override;
99 int kerning( uint32 first_char, uint32 second_char, uint32 character_size )
const override;
119 const Glyph&
glyph ( uint32 codepoint, uint32 character_size )
const override;
147 bool load(
const std::string& filename )
override;
159 bool build ( uint32 character_size );
161 const GlyphPage& pages (
void )
const;
163 sint sheet_width (
void )
const;
164 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.