88 } |
88 } |
89 |
89 |
90 struct asc_font_cache_entry entry; |
90 struct asc_font_cache_entry entry; |
91 entry.font = font; |
91 entry.font = font; |
92 cxmutstr fpath = asc_filesystem_combine_paths(cx_strcast(asc_context.font_path), cx_str(asc_font_filename(font.style))); |
92 cxmutstr fpath = asc_filesystem_combine_paths(cx_strcast(asc_context.font_path), cx_str(asc_font_filename(font.style))); |
|
93 asc_dprintf("Load font from %" CX_PRIstr, CX_SFMT(fpath)); |
93 entry.ttf = TTF_OpenFont(fpath.ptr, font.size); |
94 entry.ttf = TTF_OpenFont(fpath.ptr, font.size); |
94 cx_strfree(&fpath); |
95 cx_strfree(&fpath); |
95 if (entry.ttf == NULL) { |
96 if (entry.ttf == NULL) { |
96 asc_error(TTF_GetError()); |
97 asc_error(TTF_GetError()); |
97 return NULL; |
98 return NULL; |