55 if (asc_texture_uninitialized(&node->tex)) { |
55 if (asc_texture_uninitialized(&node->tex)) { |
56 asc_texture_init_rectangle(&node->tex); |
56 asc_texture_init_rectangle(&node->tex); |
57 } |
57 } |
58 |
58 |
59 // Render text onto a surface |
59 // Render text onto a surface |
|
60 TTF_Font *font = asc_font_cache_validate(node->font)->ptr; |
|
61 TTF_SetFontWrappedAlign( |
|
62 font, node->centered ? |
|
63 TTF_WRAPPED_ALIGN_CENTER : TTF_WRAPPED_ALIGN_LEFT |
|
64 ); |
60 SDL_Surface *surface = TTF_RenderUTF8_Blended_Wrapped( |
65 SDL_Surface *surface = TTF_RenderUTF8_Blended_Wrapped( |
61 asc_font_cache_validate(node->font)->ptr, |
66 font, node->text, asc_col_sdl(node->color), node->max_width |
62 node->text, |
|
63 asc_col_sdl(node->color), |
|
64 node->max_width |
|
65 ); |
67 ); |
66 if (surface == NULL) { |
68 if (surface == NULL) { |
67 asc_error(SDL_GetError()); |
69 asc_error(SDL_GetError()); |
68 return; |
70 return; |
69 } |
71 } |