bool menu_display_init_main_font(void *data, const char *font_path, float font_size) { bool ret; driver_t *driver = driver_get_ptr(); void *video = video_driver_get_ptr(NULL); menu_display_t *disp = menu_display_get_ptr(); if (!disp) return false; if (disp->font.buf) menu_display_free_main_font(); ret = menu_display_font_init_first( (const void**)&driver->font_osd_driver, &disp->font.buf, video, font_path, font_size); if (ret) disp->font.size = font_size; else disp->font.buf = NULL; return ret; }
static void zarch_context_destroy(void *data) { zui_t *zui = (zui_t*)data; if (!zui) return; menu_display_free_main_font(); zarch_context_bg_destroy(zui); }
static void zarch_context_destroy(void) { menu_handle_t *menu = menu_driver_get_ptr(); driver_t *driver = driver_get_ptr(); zui_t *zui = menu ? (zui_t*)menu->userdata : NULL; if (!menu || !zui || !driver) return; menu_display_free_main_font(); zarch_context_bg_destroy(zui); }
static void mui_context_destroy(void *data) { unsigned i; mui_handle_t *mui = (mui_handle_t*)data; if (!mui) return; for (i = 0; i < MUI_TEXTURE_LAST; i++) menu_display_texture_unload((uintptr_t*)&mui->textures.list[i].id); menu_display_free_main_font(); mui_context_bg_destroy(mui); }
static void glui_context_destroy(void) { gl_t *gl = (gl_t*)video_driver_get_ptr(NULL); glui_handle_t *glui = NULL; menu_handle_t *menu = menu_driver_get_ptr(); driver_t *driver = driver_get_ptr(); if (!menu || !menu->userdata || !gl || !driver) return; glui = (glui_handle_t*)menu->userdata; menu_display_free_main_font(menu); glui_context_bg_destroy(glui); }
bool menu_display_init_main_font(menu_handle_t *menu, const char *font_path, float font_size) { driver_t *driver = driver_get_ptr(); void *video = video_driver_get_ptr(NULL); bool result; if (menu->font.buf) menu_display_free_main_font(menu); result = menu_display_font_init_first( (const void**)&driver->font_osd_driver, &menu->font.buf, video, font_path, font_size); if (result) menu->font.size = font_size; else menu->font.buf = NULL; return result; }