21 #include "hx3d/graphics/font.hpp" 23 #include "hx3d/graphics/shader.hpp" 25 #include "hx3d/core/core.hpp" 27 #include "hx3d/utils/assets.hpp" 28 #include "hx3d/utils/file.hpp" 29 #include "hx3d/utils/log.hpp" 40 defaultSize = characterSize;
49 if (data.find(size) == data.end()) {
50 texture_atlas_t* atlas = texture_atlas_new(512, 512, 1);
51 texture_font_t* font = texture_font_new_from_memory(atlas, size, file->getData(), file->getSize());
57 data.emplace(std::make_pair(size, d));
62 if (data.find(size) == data.end()) {
unsigned int getDefaultSize() const
Get the default font size.
Data & getFontData(int size)
Get internal font data from a size.
texture_atlas_t * atlas
Internal atlas.
Centralized framework management.
const Ptr< Shader > & getShader()
Get the font shader.
Font(std::string fontPath, int characterSize)
Build a font from a path and a character size.
static Ptr< File > loadBinaryFile(std::string path)
Load a binary file from a path.
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
void createFontSize(int size)
Generate a font in cache.