29#ifndef NOMLIB_GRAPHICS_FONTS_BMFONT_HPP
30#define NOMLIB_GRAPHICS_FONTS_BMFONT_HPP
36#include "nomlib/config.hpp"
37#include "nomlib/graphics/fonts/IFont.hpp"
38#include "nomlib/graphics/fonts/FontMetrics.hpp"
39#include "nomlib/graphics/fonts/FontPage.hpp"
91 IFont* clone()
const override;
93 bool valid()
const override;
95 IFont::FontType type()
const override;
98 const Image*
image(uint32 character_size)
const override;
102 const Glyph&
glyph(uint32 codepoint, uint32 character_size)
const override;
105 int spacing(uint32 character_size)
const override;
114 int kerning(uint32 first_char, uint32 second_char, uint32 character_size)
const override;
126 int newline(uint32 character_size)
const override;
130 int point_size()
const;
132 bool use_kerning()
const;
151 bool load(
const std::string& filename)
override;
void parse_string(const std::string &key, std::string &value)
bool set_outline(int) override
bool build(uint32 character_size)
Create the texture atlas from the parsed font metrics.
int point_size_
The point size of the font.
const Size2i & page_size(uint32 page) const
bool set_hinting(int) override
int hinting() const override
const Glyph & glyph(uint32 codepoint, uint32 character_size) const override
BMFont()
Default constructor.
int spacing(uint32 character_size) const override
void set_font_style(uint32) override
bool use_kerning_
Usage state of kerning pair offsets.
void set_font_kerning(bool state) override
Set the use of kerning for the font.
bool set_point_size(int) override
std::vector< BMFontKerningPair > kernings_
Kerning pairs.
FontMetrics metrics_
The glyph characteristics for the font in use.
uint32 font_style() const override
bool load(const std::string &filename) override
virtual ~BMFont()
Destructor.
bool parse_ascii_file(std::istream &fp)
Read an input source that conforms to the BMFont file spec.
const Image * image(uint32 character_size) const override
Size2i page_size_
The total dimensions – width and height in integer pixels – of the texture atlas used to hold the gly...
int newline(uint32 character_size) const override
int kerning(uint32 first_char, uint32 second_char, uint32 character_size) const override
Obtain the kerning pair offsets between two glyphs.
Bitmap storage container.
The kerning information is used to adjust the distance between certain characters,...
int second_char_id
The second glyph identifier.
int first_char_id
The first glyph identifier.
int x_offset
How much the x position should be adjusted when drawing the second character immediately following th...
std::string filename
The texture file name for the page.
Container structure for global font metric data.
Container structure for font data.