Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
TextRenderer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "raylib.h"
6
12 public:
13 static bool loadFont(const std::string& path); // needs GL context
14 static void unloadFont(); // needs GL context
15
16 static void draw(const std::string& text, int x, int y, int fontSize, Color color);
17 static int measure(const std::string& text, int fontSize);
18
19 private:
20 static Font _font;
21 static bool _loaded;
22
23 static constexpr int BASE_SIZE =
24 32; // glyph atlas bake size (near render size to limit downscale blur)
25 static float _spacing(int fontSize);
26 static const Font& _active();
27};
Central wrapper for all GUI text. Owns one shared Font (JetBrainsMono) loaded once for the window lif...
static constexpr int BASE_SIZE
static Font _font
static float _spacing(int fontSize)
static void draw(const std::string &text, int x, int y, int fontSize, Color color)
static bool _loaded
static const Font & _active()
static bool loadFont(const std::string &path)
static int measure(const std::string &text, int fontSize)
static void unloadFont()