Implement SDF fonts. (#24)

* Initial SDF font generation work.

* Text now correctly displaying with proper spacing.

* Fix untextured draws, implement custom rectangles.

* Fix regular image display.

* Slightly refactor ImGui rendering.

* Implement outlines.

* Implement bevel.

* Create host device after loading the module if the installer wasn't run.

* Move ImGui files to its own folder.

* Fix outline sizes.

* Fix default ImGui font and font scales.

* Update font atlas files.
This commit is contained in:
Skyth (Asilkan)
2024-12-11 23:30:19 +03:00
committed by GitHub
parent 632cf2619e
commit cdcacff53b
23 changed files with 536 additions and 154 deletions

View File

@@ -11,7 +11,7 @@
#include <res/images/common/general_window.dds.h>
#include <decompressor.h>
#include <res/images/common/select_fade.dds.h>
#include <gpu/imgui_snapshot.h>
#include <gpu/imgui/imgui_snapshot.h>
constexpr double OVERLAY_CONTAINER_COMMON_MOTION_START = 0;
constexpr double OVERLAY_CONTAINER_COMMON_MOTION_END = 11;
@@ -256,9 +256,7 @@ void MessageWindow::Init()
{
auto& io = ImGui::GetIO();
constexpr float FONT_SCALE = 2.0f;
g_fntSeurat = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf", 24.0f * FONT_SCALE);
g_fntSeurat = ImFontAtlasSnapshot::GetFont("FOT-SeuratPro-M.otf");
g_upSelectionCursor = LOAD_ZSTD_TEXTURE(g_select_fade);
g_upWindow = LOAD_ZSTD_TEXTURE(g_general_window);