mirror of
https://github.com/obsqrbtz/clrsync.git
synced 2026-04-09 12:37:41 +03:00
chore: structured src/gui, run clang-format
This commit is contained in:
31
src/gui/platform/font_loader.hpp
Normal file
31
src/gui/platform/font_loader.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef CLRSYNC_GUI_SYSTEM_FONT_LOADER_HPP
|
||||
#define CLRSYNC_GUI_SYSTEM_FONT_LOADER_HPP
|
||||
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class font_loader
|
||||
{
|
||||
public:
|
||||
font_loader() = default;
|
||||
|
||||
ImFont *load_font(const char *font_name, float size_px);
|
||||
void push_default_font();
|
||||
void pop_font();
|
||||
|
||||
std::vector<std::string> get_system_fonts();
|
||||
|
||||
private:
|
||||
std::string find_font_path(const char *font_name);
|
||||
|
||||
#if defined(_WIN32)
|
||||
static std::string find_font_windows(const char *font_name);
|
||||
#elif defined(__APPLE__)
|
||||
std::vector<unsigned char> load_font_macos(const char *font_name);
|
||||
#else
|
||||
std::string find_font_linux(const char *font_name);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // CLRSYNC_GUI_SYSTEM_FONT_LOADER_HPP
|
||||
Reference in New Issue
Block a user