From ca4d5bad8c84bfc584dc8db665db06a3676843ff Mon Sep 17 00:00:00 2001 From: vurtun Date: Wed, 20 Apr 2016 19:53:26 +0200 Subject: [PATCH] Fixed blurry font for examples Oversampling for the default font is tweaked for the default font with height 13. I set the wrong height for all examples which should now be fixed. --- example/calculator.c | 4 ++-- example/file_browser.c | 6 +++--- example/node_editor.c | 4 ++-- example/overview.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/example/calculator.c b/example/calculator.c index 52cdc524..6f7529e4 100644 --- a/example/calculator.c +++ b/example/calculator.c @@ -311,8 +311,8 @@ int main(int argc, char *argv[]) const char *font_path = (argc > 1) ? argv[1]: 0; nk_font_atlas_init_default(&atlas); nk_font_atlas_begin(&atlas); - if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 14.0f, NULL); - else font = nk_font_atlas_add_default(&atlas, 14.0f, NULL); + if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 13.0f, NULL); + else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} diff --git a/example/file_browser.c b/example/file_browser.c index 03e16000..9834111f 100644 --- a/example/file_browser.c +++ b/example/file_browser.c @@ -402,7 +402,7 @@ file_browser_run(struct file_browser *browser, struct nk_context *ctx) struct nk_rect total_space; if (nk_begin(ctx, &layout, "File Browser", nk_rect(50, 50, 800, 600), - NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_CLOSABLE|NK_WINDOW_MOVABLE)) + NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_MOVABLE)) { struct nk_panel sub; static float ratio[] = {0.25f, NK_UNDEFINED}; @@ -808,8 +808,8 @@ int main(int argc, char *argv[]) const char *font_path = (argc > 1) ? argv[1]: 0; nk_font_atlas_init_default(&atlas); nk_font_atlas_begin(&atlas); - if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 14.0f, NULL); - else font = nk_font_atlas_add_default(&atlas, 14.0f, NULL); + if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 13.0f, NULL); + else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} diff --git a/example/node_editor.c b/example/node_editor.c index d2b49a55..595a87f9 100644 --- a/example/node_editor.c +++ b/example/node_editor.c @@ -656,8 +656,8 @@ int main(int argc, char *argv[]) const char *font_path = (argc > 1) ? argv[1]: 0; nk_font_atlas_init_default(&atlas); nk_font_atlas_begin(&atlas); - if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 14.0f, NULL); - else font = nk_font_atlas_add_default(&atlas, 14.0f, NULL); + if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 13.0f, NULL); + else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} diff --git a/example/overview.c b/example/overview.c index b8825d1d..2b7126b8 100644 --- a/example/overview.c +++ b/example/overview.c @@ -1407,8 +1407,8 @@ int main(int argc, char *argv[]) const char *font_path = (argc > 1) ? argv[1]: 0; nk_font_atlas_init_default(&atlas); nk_font_atlas_begin(&atlas); - if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 14.0f, NULL); - else font = nk_font_atlas_add_default(&atlas, 14.0f, NULL); + if (font_path) font = nk_font_atlas_add_from_file(&atlas, font_path, 13.0f, NULL); + else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);}