src/text.c

changeset 66
8297afa1c29c
parent 65
9c44c55d327a
     1.1 --- a/src/text.c	Thu Apr 18 22:53:55 2024 +0200
     1.2 +++ b/src/text.c	Fri Apr 19 22:28:29 2024 +0200
     1.3 @@ -59,8 +59,7 @@
     1.4      }
     1.5  
     1.6      // Render text onto a surface
     1.7 -    // TODO: obtain TTF_Font from font cache once it is repaired
     1.8 -    TTF_Font *font = node->font.ptr;
     1.9 +    TTF_Font *font = asc_font_load(node->font);
    1.10      static int alignments[] = {
    1.11              TTF_WRAPPED_ALIGN_LEFT,
    1.12              TTF_WRAPPED_ALIGN_CENTER,
    1.13 @@ -102,7 +101,7 @@
    1.14      node->base.position.x = (float) args.x;
    1.15      node->base.position.y = (float) args.y;
    1.16      node->max_width = args.max_width;
    1.17 -    node->font = *asc_active_font;
    1.18 +    node->font = asc_active_font;
    1.19      node->color = asc_context.ink;
    1.20      if (args.text == NULL) {
    1.21          node->text = cx_mutstr(strdup(" "));

mercurial