This commit is contained in:
asrael 2025-09-28 13:10:29 -05:00
parent 9f96626ea7
commit 6a02b24ae6
29 changed files with 653 additions and 583 deletions

View file

@ -2,18 +2,6 @@
#include <SDL3/SDL.h>
#include <string.h>
const pxl8_glyph* pxl8_font_find_glyph(const pxl8_font* font, u32 codepoint) {
if (!font || !font->glyphs) return NULL;
for (u32 i = 0; i < font->glyph_count; i++) {
if (font->glyphs[i].codepoint == codepoint) {
return &font->glyphs[i];
}
}
return NULL;
}
pxl8_result pxl8_font_create_atlas(const pxl8_font* font, u8** atlas_data, i32* atlas_width, i32* atlas_height) {
if (!font || !atlas_data || !atlas_width || !atlas_height) {
return PXL8_ERROR_NULL_POINTER;
@ -58,3 +46,15 @@ pxl8_result pxl8_font_create_atlas(const pxl8_font* font, u8** atlas_data, i32*
return PXL8_OK;
}
const pxl8_glyph* pxl8_font_find_glyph(const pxl8_font* font, u32 codepoint) {
if (!font || !font->glyphs) return NULL;
for (u32 i = 0; i < font->glyph_count; i++) {
if (font->glyphs[i].codepoint == codepoint) {
return &font->glyphs[i];
}
}
return NULL;
}