1 #ifndef FONT_GENERATOR_H
2 #define FONT_GENERATOR_H
5 #include <freetype2/ft2build.h>
19 std::string font_path;
20 unsigned int pixels_per_unit;
21 std::map<std::string, std::shared_ptr<Font>> fonts;
29 FontGenerator(
const std::string& font_path =
"",
const unsigned int pixels_per_unit = 32);
42 void setFontPath(
const std::string& font_path) noexcept;
57 void loadFont(
const std::string& ttf_file,
const unsigned int size,
const std::string& name=
"");
65 std::shared_ptr<Font>
getFont(
const std::string& name)
const noexcept;
FontGenerator(const std::string &font_path="", const unsigned int pixels_per_unit=32)
Font generator constructor.
Definition: font_generator.cpp:9
Class for font generator.
Definition: font_generator.h:16
std::string getFontPath() const noexcept
Gets the font path.
Definition: font_generator.cpp:27
~FontGenerator()
Destroys the font generator.
Definition: font_generator.cpp:15
void loadFont(const std::string &ttf_file, const unsigned int size, const std::string &name="")
Loads a font.
Definition: font_generator.cpp:31
std::shared_ptr< Font > getFont(const std::string &name) const noexcept
Gets the font.
Definition: font_generator.cpp:132
void setFontPath(const std::string &font_path) noexcept
Sets the font path.
Definition: font_generator.cpp:23