From b3aa7c607b5e4e369bbb908b9130523d4a47fcb4 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Wed, 4 Apr 2018 00:01:17 -0700 Subject: Fix silly bug in handling of Mac Roman font names. Make Mac font search more exhaustive if the faster prefix check fails. Added a bunch of debug printfs in case those aren't sufficient to get things working on other machines --- nuklear_ui/sfnt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nuklear_ui/sfnt.c') diff --git a/nuklear_ui/sfnt.c b/nuklear_ui/sfnt.c index 7c69a90..1636af5 100644 --- a/nuklear_ui/sfnt.c +++ b/nuklear_ui/sfnt.c @@ -200,9 +200,9 @@ char *sfnt_name(sfnt_table *sfnt, uint16_t name_type) } if (entry == macroman_entry) { //TODO: convert these properly to UTF-8 - char *ret = malloc(name_size + 1); + char *ret = malloc(name_length + 1); memcpy(ret, name_table + full_off, name_length); - ret[name_size] = 0; + ret[name_length] = 0; return ret; } else { return utf16be_to_utf8(name_table + full_off, name_length/2); -- cgit v1.2.3