waver : fix font loading and snap build

This commit is contained in:
Georgi Gerganov
2021-02-27 22:36:36 +02:00
parent 770e464722
commit 74f35ebcf0
8 changed files with 35 additions and 24 deletions

View File

@@ -99,3 +99,9 @@ if (GGWAVE_SUPPORT_SDL2)
add_subdirectory(waver)
add_subdirectory(spectrogram)
endif()
install(TARGETS ggwave-common LIBRARY DESTINATION lib)
if (GGWAVE_SUPPORT_SDL2)
install(TARGETS ggwave-common-sdl2 LIBRARY DESTINATION lib)
endif()

View File

@@ -123,3 +123,9 @@ if (GGWAVE_SUPPORT_SDL2)
)
endif()
endif()
install(TARGETS imgui LIBRARY DESTINATION lib)
if (GGWAVE_SUPPORT_SDL2)
install(TARGETS imgui-sdl2 LIBRARY DESTINATION lib)
endif()

View File

@@ -43,4 +43,9 @@ else()
imgui-sdl2
${CMAKE_THREAD_LIBS_INIT}
)
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/DroidSans.ttf DESTINATION bin)
install(FILES ${PROJECT_SOURCE_DIR}/examples/assets/fonts/fontawesome-webfont.ttf DESTINATION bin)
endif()
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)

View File

@@ -229,15 +229,21 @@ int main(int argc, char** argv) {
ImGui_Init(window, gl_context);
ImGui::GetIO().IniFilename = nullptr;
ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../bin/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
{
bool isNotLoaded = true;
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../bin/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/DroidSans.ttf", kGlobalImGuiScale*14.0f, false);
}
ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../bin/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
{
bool isNotLoaded = true;
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../bin/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
isNotLoaded = isNotLoaded && !ImGui_tryLoadFont(getBinaryPath() + "../../examples/assets/fonts/fontawesome-webfont.ttf", kGlobalImGuiScale*14.0f, true);
}
ImGui_SetStyle();