1#ifndef OE_GUI_FONT_ATLAS_H
2#define OE_GUI_FONT_ATLAS_H
16struct nk_draw_null_texture;
51 FontAtlas*
addFile(
const std::string& font_name,
const std::string& font_file,
const float& size);
58 return _tex !=
nullptr;
74 return std::get<2>(_font_conf.at(font_id).second);
80 nk_font*
getHandle(
const std::string& font_id)
const;
82 nk_font* getDefaultFont()
87 const std::unique_ptr<oe::render::Texture>& getTexture()
98 std::vector<std::pair<std::string, std::tuple<std::string, float, nk_font*>>> _font_conf;
100 std::unique_ptr<oe::render::Texture> _tex;
101 std::unique_ptr<nk_font_atlas> _atlas;
103 nk_font* _default_font =
nullptr;
Handle and bake font atlas for using in the GUI.
Definition font_atlas.h:28
FontAtlas * addFile(const std::string &font_name, const std::string &font_file, const float &size)
Add a font from a file.
glm::vec2 white_pixel_uv
uv coordinates of a white pixel in the texture
Definition font_atlas.h:95
bool isValid() const
Check if the font atlas is ready to use.
Definition font_atlas.h:56
size_t getIdFromName(const std::string &font_id) const
Get a font name from the list when you know its id.
nk_font * getHandle(const size_t &font_id) const
Get a font handle when you know its id.
Definition font_atlas.h:72
nk_font * getHandle(const std::string &font_id) const
Get a font handle from the custom font name.
void generate()
Generate the atlas.
Graphical user interface (panels, buttons, text input, ...)
Definition component.h:13
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures)
Definition opengl.h:10