From 55f4aaf179cf723c5b703b0c4d848bf059ae190a Mon Sep 17 00:00:00 2001 From: WBoerenkamps Date: Mon, 16 Dec 2024 19:08:22 +0100 Subject: font family implemented in the text component --- src/crepe/facade/FontFacade.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/crepe/facade/FontFacade.h (limited to 'src/crepe/facade/FontFacade.h') diff --git a/src/crepe/facade/FontFacade.h b/src/crepe/facade/FontFacade.h new file mode 100644 index 0000000..1b835d4 --- /dev/null +++ b/src/crepe/facade/FontFacade.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +#include "../api/Asset.h" + +namespace crepe { + +/** + * + * \brief Font facade class for converting font family names to absolute file paths + * + */ +class FontFacade { +public: + /** + * + * \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 is static so the member function can be used without create a FontFacade object. This way it can be used in a constructor as FontFacade::get_font_asset(). + * \param font_family Name of the font family name. + * \return Asset with filepath to the font. + */ + static Asset get_font_asset(const std::string font_family); +}; + +} // namespace crepe -- cgit v1.2.3