Shirag 0.1.0
Loading...
Searching...
No Matches
fonts.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <raylib.h>
4#include <string>
5#include <vector>
6
7namespace Shirag::Text {
8
10 struct Font { // [TASKIG] add overload for codepoints
11 private:
12 ::Font font;
13
14 public:
16 constexpr int size() const {
17 return font.baseSize;
18 }
19 ::Font baseFont() const {
20 return font;
21 }
23 Font(std::string FilePath) {
24 font = LoadFont(FilePath.c_str());
25 }
27 Font(std::string FilePath, int FontSize) {
28 font = LoadFontEx(FilePath.c_str(), FontSize, NULL, 0);
29 }
30 };
31
33 Font* findClosestFont(std::vector<Font>* Fonts, int TargetFontSize);
34
35}
Definition fonts.hpp:7
Font * findClosestFont(std::vector< Font > *Fonts, int TargetFontSize)
Finds the font closest to the target size.
Definition fonts.cpp:5
Struct for advanced versions of the Raylib Font struct.
Definition fonts.hpp:10
constexpr int size() const
Gets the fontsize.
Definition fonts.hpp:16
Font(std::string FilePath, int FontSize)
Load font size with specified size.
Definition fonts.hpp:27
Font(std::string FilePath)
Load basic font with normal size.
Definition fonts.hpp:23
::Font baseFont() const
Definition fonts.hpp:19