src/text.c

changeset 66
8297afa1c29c
parent 65
9c44c55d327a
child 71
baa73a0be3ce
--- a/src/text.c	Thu Apr 18 22:53:55 2024 +0200
+++ b/src/text.c	Fri Apr 19 22:28:29 2024 +0200
@@ -59,8 +59,7 @@
     }
 
     // Render text onto a surface
-    // TODO: obtain TTF_Font from font cache once it is repaired
-    TTF_Font *font = node->font.ptr;
+    TTF_Font *font = asc_font_load(node->font);
     static int alignments[] = {
             TTF_WRAPPED_ALIGN_LEFT,
             TTF_WRAPPED_ALIGN_CENTER,
@@ -102,7 +101,7 @@
     node->base.position.x = (float) args.x;
     node->base.position.y = (float) args.y;
     node->max_width = args.max_width;
-    node->font = *asc_active_font;
+    node->font = asc_active_font;
     node->color = asc_context.ink;
     if (args.text == NULL) {
         node->text = cx_mutstr(strdup(" "));

mercurial