aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/facade/FontFacade.h
blob: 2e08f3f47ffeec6ecce852f4cb969a8a3b01ab95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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