diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 19:16:25 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-12-17 19:16:25 +0100 |
commit | b421eec1073c1fb4b99d46cc36c5c9cbd8d3c4a7 (patch) | |
tree | 461e290e0c2c3adf588f02d24031edc7f8114390 /src/crepe/facade/FontFacade.h | |
parent | c4c896c2995f2b74fca322736aa944b28b14a1f6 (diff) | |
parent | a8ccf7fe8662086bb223aa4eafd0f85e717d16cf (diff) |
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/button-improvement
Diffstat (limited to 'src/crepe/facade/FontFacade.h')
-rw-r--r-- | src/crepe/facade/FontFacade.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/crepe/facade/FontFacade.h b/src/crepe/facade/FontFacade.h new file mode 100644 index 0000000..9761070 --- /dev/null +++ b/src/crepe/facade/FontFacade.h @@ -0,0 +1,34 @@ +#pragma once + +#include <memory> + +#include "../api/Asset.h" + +namespace crepe { + +/** + * + * \brief Font facade class for converting font family names to absolute file paths + * + */ +class FontFacade { +public: + FontFacade(); + ~FontFacade(); + FontFacade(const FontFacade & other) = delete; + FontFacade & operator=(const FontFacade & other) = delete; + FontFacade(FontFacade && other) noexcept = delete; + FontFacade & operator=(FontFacade && other) noexcept = delete; + /** + * + * \brief Facade function to convert a font_family into an asset. + * + * This function uses the FontConfig library to convert a font family name (Arial, Inter, Helvetica) and converts it to the font source path. + * This function returns a default font path if the font_family name doesnt exist or cant be found + * \param font_family Name of the font family name. + * \return Asset with filepath to the corresponding font. + */ + Asset get_font_asset(const std::string & font_family); +}; + +} // namespace crepe |