49 font, alignments[text->base.data.flags & ASC_TEXT_ALIGNMENT_MASK]); |
49 font, alignments[text->base.data.flags & ASC_TEXT_ALIGNMENT_MASK]); |
50 SDL_Surface *surface = TTF_RenderUTF8_Blended_Wrapped( |
50 SDL_Surface *surface = TTF_RenderUTF8_Blended_Wrapped( |
51 font, text->text.ptr, asc_col_sdl(text->color), text->max_width |
51 font, text->text.ptr, asc_col_sdl(text->color), text->max_width |
52 ); |
52 ); |
53 if (surface == NULL) { |
53 if (surface == NULL) { |
54 asc_error(SDL_GetError()); |
54 asc_error("Rendering TTF surface failed: %s", SDL_GetError()); |
55 return; |
55 return; |
56 } |
56 } |
57 asc_set_scale2d(node, surface->w, surface->h); |
57 asc_set_scale2d(node, surface->w, surface->h); |
58 if (asc_test_flag(text->base.data.flags, ASC_TEXT_CENTERED_FLAG)) { |
58 if (asc_test_flag(text->base.data.flags, ASC_TEXT_CENTERED_FLAG)) { |
59 unsigned short newoffx = surface->w / 2; |
59 unsigned short newoffx = surface->w / 2; |