Handle multiple font styles

Adds support for font styles other than normal, such as bold, italics,
and bold italics.
This commit is contained in:
Leroy Hopson 2024-02-10 17:15:33 +13:00
parent fb3fb6855c
commit 3f24fa9bf0
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 30 additions and 10 deletions

View file

@ -3,6 +3,8 @@
#pragma once
#include<map>
#include <godot_cpp/classes/control.hpp>
#include <godot_cpp/classes/image_texture.hpp>
#include <godot_cpp/classes/rendering_server.hpp>
@ -27,6 +29,13 @@ namespace godot
"normal_font", "bold_font", "italics_font", "bold_italics_font",
};
enum FontType {
NORMAL,
BOLD,
ITALICS,
BOLD_ITALICS,
};
public:
enum AttrFlag
{
@ -92,8 +101,9 @@ namespace godot
tsm_age_t age, void *data);
PackedColorArray palette;
Ref<Font> font;
std::map<FontType, Ref<Font>> fonts;
int32_t font_size;
double font_offset;
Vector2 size;
Vector2 cell_size;