Mercurial > repos > blastem
diff nuklear_ui/blastem_nuklear.c @ 1527:4f6e8acd7b6a nuklear_ui
Added support for TTC and dfont format true type fonts. More robust font selection on Windows
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 06 Mar 2018 21:27:12 -0800 |
parents | 9bea1a199f15 |
children | 3faf917bab56 |
line wrap: on
line diff
--- a/nuklear_ui/blastem_nuklear.c Wed Feb 07 19:21:44 2018 -0800 +++ b/nuklear_ui/blastem_nuklear.c Tue Mar 06 21:27:12 2018 -0800 @@ -902,11 +902,12 @@ nk_sdl_device_create(); struct nk_font_atlas *atlas; nk_sdl_font_stash_begin(&atlas); - char *font = default_font_path(); + uint32_t font_size; + uint8_t *font = default_font(&font_size); if (!font) { fatal_error("Failed to find default font path\n"); } - struct nk_font *def_font = nk_font_atlas_add_from_file(atlas, font, 30, NULL); + struct nk_font *def_font = nk_font_atlas_add_from_memory(atlas, font, font_size, 30, NULL); nk_sdl_font_stash_end(); nk_style_set_font(context, &def_font->handle); } @@ -944,11 +945,14 @@ struct nk_font_atlas *atlas; nk_sdl_font_stash_begin(&atlas); - char *font = default_font_path(); + //char *font = default_font_path(); + uint32_t font_size; + uint8_t *font = default_font(&font_size); if (!font) { fatal_error("Failed to find default font path\n"); } - struct nk_font *def_font = nk_font_atlas_add_from_file(atlas, font, 30, NULL); + //struct nk_font *def_font = nk_font_atlas_add_from_file(atlas, font, 30, NULL); + struct nk_font *def_font = nk_font_atlas_add_from_memory(atlas, font, font_size, 30, NULL); nk_sdl_font_stash_end(); nk_style_set_font(context, &def_font->handle); current_view = file_loaded ? view_play : view_menu;