diff options
author | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-12-17 11:41:05 +0100 |
---|---|---|
committer | Hanspeter Portner <dev@open-music-kontrollers.ch> | 2016-12-17 11:41:05 +0100 |
commit | 16c13d87231e46d9533f022214afd36068053bac (patch) | |
tree | f5154b4b97584b0d4b8c4fe7d4876cd6369d3abe /nk_pugl | |
parent | 03016b3ec6b15d04dcef03bae2e58dc406d2d059 (diff) | |
parent | 62d7223881ea45d74815317b76cebcf2798560b5 (diff) | |
download | sherlock.lv2-16c13d87231e46d9533f022214afd36068053bac.tar.xz |
Merge commit '62d7223881ea45d74815317b76cebcf2798560b5'
Diffstat (limited to 'nk_pugl')
-rw-r--r-- | nk_pugl/nk_pugl.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h index 362f33d..817d065 100644 --- a/nk_pugl/nk_pugl.h +++ b/nk_pugl/nk_pugl.h @@ -19,7 +19,7 @@ #define _NK_PUGL_H #include <stdatomic.h> -#include <ctype.h> // isprint +#include <ctype.h> // isalpha #ifdef __cplusplus extern C { @@ -519,7 +519,7 @@ _nk_pugl_other_key(struct nk_context *ctx, const PuglEventKey *ev, int down) default: { - if(down && isprint(ev->character)) + if(down && isalpha(character)) nk_input_char(ctx, character); } break; } @@ -563,7 +563,7 @@ _nk_pugl_other_key(struct nk_context *ctx, const PuglEventKey *ev, int down) } break; } - if(down && isprint(ev->character)) + if(down) nk_input_glyph(ctx, (const char *)ev->utf8); } break; } @@ -758,7 +758,18 @@ nk_pugl_init(nk_pugl_window_t *win) // init nuklear font struct nk_font *ttf = NULL; struct nk_font_config fcfg = nk_font_config(cfg->font.size); - fcfg.range = nk_font_cyrillic_glyph_ranges(); + const nk_rune range [] = { + 0x0020, 0x007F, // Basic Latin + 0x00A0, 0x00FF, // Latin-1 Supplement + 0x0100, 0x017F, // Latin Extended-A + 0x0180, 0x024F, // Latin Extended-B + 0x0300, 0x036F, // Combining Diacritical Marks + 0x0370, 0x03FF, // Greek and Coptic + 0x0400, 0x04FF, // Cyrillic + 0x0500, 0x052F, // Cyrillic Supplementary + 0 + }; + fcfg.range = range; _nk_pugl_font_stash_begin(win); if(cfg->font.face && cfg->font.size) |