src/font.c

changeset 92
78ce93fb46e5
parent 88
6234b7ea48f3
--- a/src/font.c	Tue Apr 22 19:36:27 2025 +0200
+++ b/src/font.c	Wed Apr 23 23:43:45 2025 +0200
@@ -89,16 +89,17 @@
 
     struct asc_font_cache_entry entry;
     entry.font = font;
-    cxmutstr fpath = asc_filesystem_combine_paths(cx_strcast(asc_context.font_path), cx_str(asc_font_filename(font.style)));
+    const char *font_name = asc_font_filename(font.style);
+    cxmutstr fpath = asc_filesystem_combine_paths(cx_strcast(asc_context.font_path), cx_str(font_name));
     asc_dprintf("Load font from %" CX_PRIstr, CX_SFMT(fpath));
     entry.ttf = TTF_OpenFont(fpath.ptr, font.size);
     cx_strfree(&fpath);
     if (entry.ttf == NULL) {
-        asc_error(TTF_GetError());
+        asc_error("Failed to load font %s: %s", font_name, TTF_GetError());
         return NULL;
     } else {
         cxListAdd(asc_font_cache, &entry);
-        asc_dprintf("Loaded font size %d, style %d from disk", font.size, font.style);
+        asc_dprintf("Loaded font size %d, style %d from %s", font.size, font.style, font_name);
         return entry.ttf;
     }
 }

mercurial