Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::text::BitmapFont Class Reference

#include <BitmapFont.hpp>

Classes

struct  TextMetrics

Public Member Functions

bool loadFromFntText (const std::string &content, const std::string &basePath, resource::ResourceManager &rm)
bool loadFromFntText (const std::string &content, resource::TextureHandle texture, u32 texWidth, u32 texHeight)
void createLabelAtlas (resource::TextureHandle texture, u32 texWidth, u32 texHeight, const std::string &chars, u32 charWidth, u32 charHeight)
TextMetrics measureText (const std::string &text, f32 fontSize, f32 spacing) const
const Glyph * getGlyph (u32 charCode) const
f32 getKerning (u32 first, u32 second) const
resource::TextureHandle getTexture () const
f32 getLineHeight () const
f32 getBase () const
u32 getTexWidth () const
u32 getTexHeight () const

Detailed Description

Definition at line 25 of file BitmapFont.hpp.

Member Function Documentation

◆ createLabelAtlas()

◆ getBase()

f32 esengine::text::BitmapFont::getBase ( ) const
inline

Definition at line 51 of file BitmapFont.hpp.

◆ getGlyph()

const Glyph * esengine::text::BitmapFont::getGlyph ( u32 charCode) const

Definition at line 190 of file BitmapFont.cpp.

Referenced by measureText().

◆ getKerning()

f32 esengine::text::BitmapFont::getKerning ( u32 first,
u32 second ) const

Definition at line 195 of file BitmapFont.cpp.

Referenced by measureText().

◆ getLineHeight()

f32 esengine::text::BitmapFont::getLineHeight ( ) const
inline

Definition at line 50 of file BitmapFont.hpp.

◆ getTexHeight()

u32 esengine::text::BitmapFont::getTexHeight ( ) const
inline

Definition at line 53 of file BitmapFont.hpp.

◆ getTexture()

resource::TextureHandle esengine::text::BitmapFont::getTexture ( ) const
inline

Definition at line 49 of file BitmapFont.hpp.

◆ getTexWidth()

u32 esengine::text::BitmapFont::getTexWidth ( ) const
inline

Definition at line 52 of file BitmapFont.hpp.

◆ loadFromFntText() [1/2]

bool esengine::text::BitmapFont::loadFromFntText ( const std::string & content,
const std::string & basePath,
resource::ResourceManager & rm )

◆ loadFromFntText() [2/2]

bool esengine::text::BitmapFont::loadFromFntText ( const std::string & content,
resource::TextureHandle texture,
u32 texWidth,
u32 texHeight )

Definition at line 114 of file BitmapFont.cpp.

References ES_LOG_ERROR.

◆ measureText()

BitmapFont::TextMetrics esengine::text::BitmapFont::measureText ( const std::string & text,
f32 fontSize,
f32 spacing ) const

Definition at line 170 of file BitmapFont.cpp.

References getGlyph(), getKerning(), and esengine::text::nextCodepoint().


The documentation for this class was generated from the following files: