1 #ifndef RAYLIB_CPP_FONT_HPP_
2 #define RAYLIB_CPP_FONT_HPP_
14 #include "./raylib-cpp-utils.hpp"
20 set(GetFontDefault());
23 Font(
const std::string& fileName) {
24 set(LoadFont(fileName.c_str()));
27 Font(
const std::string& fileName,
int fontSize,
int* fontChars,
int charCount) {
28 set(LoadFontEx(fileName.c_str(), fontSize, fontChars, charCount));
32 set(LoadFontFromImage(image, key, firstChar));
43 void set(const ::Font font) {
44 baseSize = font.baseSize;
45 charsCount = font.charsCount;
46 texture = font.texture;
52 baseSize = font.baseSize;
53 charsCount = font.charsCount;
54 texture = font.texture;
59 GETTERSETTER(
int,BaseSize,baseSize)
60 GETTERSETTER(
int,CharsCount,charsCount)
63 GETTERSETTER(CharInfo*,Chars,chars)
76 ::DrawTextEx(*
this, text.c_str(), position, fontSize, spacing, tint);
80 ::DrawTextRec(*
this, text.c_str(), rec, fontSize, spacing, wordWrap, tint);
83 inline Font&
DrawText(
const std::string& text, ::
Rectangle rec,
float fontSize,
float spacing,
bool wordWrap,
Color tint,
int selectStart,
int selectLength, ::
Color selectText,
Color selectBack) {
84 ::DrawTextRecEx(*
this, text.c_str(), rec, fontSize, spacing, wordWrap, tint, selectStart, selectLength, selectText, selectBack);
89 return ::MeasureTextEx(*
this, text.c_str(), fontSize, spacing);
93 return ::GetGlyphIndex(*
this, character);