Change text renderer to pango (supports all languages and loads font automatically), start on game detection

This commit is contained in:
dec05eba
2026-04-18 00:37:16 +02:00
parent 72c8c79896
commit 010787854e
39 changed files with 636 additions and 886 deletions

View File

@@ -8,8 +8,7 @@
namespace gsr {
class Label : public Widget {
public:
// TODO: Allow specifying max width, at which either a line-break should occur or elipses should show
Label(mgl::Font *font, const char *text, mgl::Color color);
Label(const char *font_desc, const char *text, mgl::Color color);
Label(const Label&) = delete;
Label& operator=(const Label&) = delete;
@@ -18,8 +17,14 @@ namespace gsr {
mgl::vec2f get_size() override;
void set_text(std::string str);
const std::string& get_text() const;
void set_text(std::string_view str);
std::string_view get_text() const;
// Set to 0 to disable
void set_wrap_width(int width);
// Set to 0 to disable
void set_max_rows(int max_rows);
private:
mgl::Text text;
};