diff options
Diffstat (limited to 'src/unix')
| -rw-r--r-- | src/unix/main_unix.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/unix/main_unix.cpp b/src/unix/main_unix.cpp index 0c58d02..ef8dd88 100644 --- a/src/unix/main_unix.cpp +++ b/src/unix/main_unix.cpp @@ -8,6 +8,7 @@ #include "array.h" #include "memory_bucket.h" #include "image.h" +#include "fonts.h" #include "config.h" #include <stdio.h> #include <stdlib.h> @@ -15,6 +16,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <dirent.h> +#include <locale.h> #define GL_SILENCE_DEPRECATION #if defined(IMGUI_IMPL_OPENGL_ES2) #include <GLES2/gl2.h> @@ -69,6 +71,22 @@ static void drop_callback(GLFWwindow* window, int count, const char** paths) } } +ts_font_range _ts_get_font_range_to_load() { + wchar_t buffer[50] = {0}; + char* ll = setlocale(LC_ALL, NULL); + mbstowcs (buffer, ll, 50); + + wchar_t* iter = buffer; + while (*iter) { + if (*iter == ' ') *iter = 0; + if (*iter == '.') *iter = 0; + if (*iter == '@') *iter = 0; + iter++; + } + + return ts_locale_to_range(buffer); +} + // Main code int main(int, char**) { @@ -126,8 +144,8 @@ int main(int, char**) // Setup Dear ImGui style ImGui::Spectrum::StyleColorsSpectrum(); - ImGui::Spectrum::LoadFont(18.0f); + ts_load_fonts(18.0f, _ts_get_font_range_to_load()); ts_load_images(); ts_load_config(); |
