SubFont class reference


Inaccessable class whose objects are used in 'main' Font class. Directly represents a font with a specific size. Responsible for creating texture atlas.

Functions documentation

SubFont(Font* parent, int fontSize, Dimension<size_t> texDimension);

Private constructor. Setups a texture for specific font size. Allows to create textures with specific dimensions.


SubFont(const SubFont& copy) = delete;

No copy constructor for now.


Destructor - deallocates memory.


const GlyphData* GetGlyph(int ch);

Returns glyph data.


Texture* GetAtlasTexture();

Returns the texture used in the SubFont.


const int GetLineHeight() const;

Returns new line height for SubFont.


std::map<int, GlyphData>::iterator AddGlyph(int ch);

Adds a glyph (from the character) to a SubFont.


Variables documentation

int m_iFontSize;

Stores font size.


int m_iFontHeight;

Stores font new line height.


std::map<int, GlyphData> m_GlyphsInfo;

Stores glyphs data.


Font* m_ParentFontObj;

Stores a handle (pointer) to the parent Font object.


Dimension<size_t> m_AtlasDim;

Stores atlas texture dimensions.


Point<int> m_TexOffsets;

Describes the current cursor position on the texture to allow further glyphs to be added.


Texture* m_AtlasTexture;

Stores a handle (pointer) to the Texture object.