Files
armorpaint/paint/sources/slot_font.c
T

22 lines
481 B
C
Raw Normal View History

2026-03-09 13:17:15 +01:00
#include "global.h"
2026-03-07 21:12:59 +01:00
slot_font_t *slot_font_create(char *name, draw_font_t *font, char *file) {
2026-03-06 12:56:38 +01:00
slot_font_t *raw = GC_ALLOC_INIT(slot_font_t, {0});
raw->preview_ready = false;
raw->id = 0;
2026-06-05 20:34:10 +02:00
for (i32 i = 0; i < g_project->_->fonts->length; ++i) {
slot_font_t *slot = g_project->_->fonts->buffer[i];
2026-03-06 12:56:38 +01:00
if (slot->id >= raw->id) {
raw->id = slot->id + 1;
}
}
raw->name = string_copy(name);
raw->font = font;
raw->file = string_copy(file);
return raw;
}