diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-26 17:48:11 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-26 17:48:11 +0000 |
commit | 30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7 (patch) | |
tree | 0e347320e8295f03efb3d12bd85e76f838bf51d3 /ui/editNetwork.cpp | |
parent | Always set pixel unpack alignment before generating font texture content (diff) | |
download | ilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.tar.bz2 ilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.tar.xz ilt-30f58cc3832bd1b5a5cadf4b0a4a9d47d024f9f7.zip |
Remove the static font cache
Each thing can own/share a font rendering itself
Diffstat (limited to 'ui/editNetwork.cpp')
-rw-r--r-- | ui/editNetwork.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/editNetwork.cpp b/ui/editNetwork.cpp index 7fbde32..ac2d93d 100644 --- a/ui/editNetwork.cpp +++ b/ui/editNetwork.cpp @@ -8,6 +8,7 @@ #include <gfx/gl/sceneShader.h> #include <gfx/models/texture.h> +const std::filesystem::path fontpath {"/usr/share/fonts/hack/Hack-Regular.ttf"}; constexpr const glm::u8vec4 TRANSPARENT_BLUE {30, 50, 255, 200}; EditNetwork::EditNetwork(Network * n) : @@ -17,7 +18,7 @@ EditNetwork::EditNetwork(Network * n) : {"ui/icon/network.png", mode.toggle<BuilderJoin>()}, {"ui/icon/network.png", mode.toggle<BuilderFreeExtend>()}, }, - blue {1, 1, &TRANSPARENT_BLUE} + blue {1, 1, &TRANSPARENT_BLUE}, font {fontpath, 15} { } @@ -66,7 +67,7 @@ void EditNetwork::render(const UIShader & shader, const UIComponent::Position & parentPos) const { if (builder) { - Text {builder->hint(), {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos); + Text {builder->hint(), font, {{50, 10}, {0, 15}}, {1, 1, 0}}.render(shader, parentPos); } builderToolbar.render(shader, parentPos); } |