Font merge demo and documentation minor additions.

Clarifies the lifetime requirements for the ranges parameter for AddFont* functions.
This commit is contained in:
Doug Binks
2015-10-25 16:06:42 +00:00
parent 0b0c460324
commit e1bc0dd7d5
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,9 @@
io.Fonts->AddFontDefault();
// Add character ranges and merge into main font
ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
// The ranges array is not copied by the AddFont* functions and is used lazily
// so ensure it is available for duration of font usage
static const ImWchar ranges[] = { 0xf000, 0xf3ff, 0 };
ImFontConfig config;
config.MergeMode = true;
io.Fonts->AddFontFromFileTTF("fontawesome-webfont.ttf", 16.0f, &config, ranges);