vurtun / nuklear

A single-header ANSI C gui library
13.69k stars 1.11k forks source link

Crash if trying to add different font #882

Open WolfyZ99 opened 5 years ago

WolfyZ99 commented 5 years ago

My app is crashing if I try to add a different font. What could be the issue of it?

`g_ctx = nk_d3d11_init(device, g_viewport.Width, g_viewport.Height, MAX_VERTEX_BUFFER, MAX_INDEX_BUFFER); struct nk_font_atlas* atlas; nk_d3d11_font_stash_begin(&atlas); //struct nk_font_config cfg = nk_font_config(22);

    //struct nk_font *droid = nk_font_atlas_add_from_file(atlas, "../../extra_font/DroidSans.ttf", 14, 0);
    //struct nk_font *robot = nk_font_atlas_add_from_file(atlas, "../../extra_font/Roboto-Regular.ttf", 14, 0);
    struct nk_font* future = nk_font_atlas_add_from_file(atlas, "../..//extra_font/kenvector_future_thin.ttf", 13, 0);
    //void* image = nk_font_atlas_bake;

    /*struct nk_font *clean = nk_font_atlas_add_from_file(atlas, "../../extra_font/ProggyClean.ttf", 12, 0);*/
    /*struct nk_font *tiny = nk_font_atlas_add_from_file(atlas, "../../extra_font/ProggyTiny.ttf", 10, 0);*/
    /*struct nk_font *cousine = nk_font_atlas_add_from_file(atlas, "../../extra_font/Cousine-Regular.ttf", 13, 0);*/

    nk_d3d11_font_stash_end(); 
    if (future)
    {
        nk_style_set_font(g_ctx, &future->handle);
    }
    `