Merge pull request #527 from dulingzhi/fix/ttc-font-offset

Fix nk_font_bake_pack() using TTC font offset incorrectly
This commit is contained in:
Rob Loach 2022-12-17 14:04:55 -05:00 committed by GitHub
commit c512ac8864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "nuklear", "name": "nuklear",
"version": "4.10.1", "version": "4.10.5",
"repo": "Immediate-Mode-UI/Nuklear", "repo": "Immediate-Mode-UI/Nuklear",
"description": "A small ANSI C gui toolkit", "description": "A small ANSI C gui toolkit",
"keywords": ["gl", "ui", "toolkit"], "keywords": ["gl", "ui", "toolkit"],

View File

@ -16619,7 +16619,7 @@ nk_font_bake_pack(struct nk_font_baker *baker,
struct stbtt_fontinfo *font_info = &baker->build[i++].info; struct stbtt_fontinfo *font_info = &baker->build[i++].info;
font_info->userdata = alloc; font_info->userdata = alloc;
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, 0)) if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0)))
return nk_false; return nk_false;
} while ((it = it->n) != config_iter); } while ((it = it->n) != config_iter);
} }
@ -29654,6 +29654,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// - [y]: Minor version with non-breaking API and library changes /// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API /// - [z]: Patch version with no direct changes to the API
/// ///
/// - 2022/12/17 (4.10.5) - Fix nk_font_bake_pack() using TTC font offset incorrectly
/// - 2022/10/24 (4.10.4) - Fix nk_str_{append,insert}_str_utf8 always returning 0 /// - 2022/10/24 (4.10.4) - Fix nk_str_{append,insert}_str_utf8 always returning 0
/// - 2022/09/03 (4.10.3) - Renamed the `null` texture variable to `tex_null` /// - 2022/09/03 (4.10.3) - Renamed the `null` texture variable to `tex_null`
/// - 2022/08/01 (4.10.2) - Fix Apple Silicon with incorrect NK_SITE_TYPE and NK_POINTER_TYPE /// - 2022/08/01 (4.10.2) - Fix Apple Silicon with incorrect NK_SITE_TYPE and NK_POINTER_TYPE

View File

@ -7,6 +7,7 @@
/// - [y]: Minor version with non-breaking API and library changes /// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API /// - [z]: Patch version with no direct changes to the API
/// ///
/// - 2022/12/17 (4.10.5) - Fix nk_font_bake_pack() using TTC font offset incorrectly
/// - 2022/10/24 (4.10.4) - Fix nk_str_{append,insert}_str_utf8 always returning 0 /// - 2022/10/24 (4.10.4) - Fix nk_str_{append,insert}_str_utf8 always returning 0
/// - 2022/09/03 (4.10.3) - Renamed the `null` texture variable to `tex_null` /// - 2022/09/03 (4.10.3) - Renamed the `null` texture variable to `tex_null`
/// - 2022/08/01 (4.10.2) - Fix Apple Silicon with incorrect NK_SITE_TYPE and NK_POINTER_TYPE /// - 2022/08/01 (4.10.2) - Fix Apple Silicon with incorrect NK_SITE_TYPE and NK_POINTER_TYPE

View File

@ -194,7 +194,7 @@ nk_font_bake_pack(struct nk_font_baker *baker,
struct stbtt_fontinfo *font_info = &baker->build[i++].info; struct stbtt_fontinfo *font_info = &baker->build[i++].info;
font_info->userdata = alloc; font_info->userdata = alloc;
if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, 0)) if (!stbtt_InitFont(font_info, (const unsigned char*)it->ttf_blob, stbtt_GetFontOffsetForIndex((const unsigned char*)it->ttf_blob, 0)))
return nk_false; return nk_false;
} while ((it = it->n) != config_iter); } while ((it = it->n) != config_iter);
} }