From 1e5bfefa3003a6085dbe09e392553c80135ce7da Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 8 Jan 2021 19:57:31 +0200 Subject: [PATCH] waver : fix font loading --- examples/waver/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/waver/main.cpp b/examples/waver/main.cpp index ad404fd..1e413fa 100644 --- a/examples/waver/main.cpp +++ b/examples/waver/main.cpp @@ -21,14 +21,16 @@ // ImGui helpers bool ImGui_tryLoadFont(const std::string & filename, float size = 14.0f, bool merge = false) { - std::ifstream f(filename.c_str()); + std::ifstream f(filename); if (f.good() == false) { + printf("XXXXXXXXxxx\n"); return false; } if (merge) { - ImWchar ranges[] = { 0xf000, 0xf3ff, 0 }; + // todo : ugly static !!! + static ImWchar ranges[] = { 0xf000, 0xf3ff, 0 }; + static ImFontConfig config; - ImFontConfig config; config.MergeMode = true; config.GlyphOffset = { 0.0f, 0.0f };