diff --git a/resources/fonts/Inter_28pt-Bold.ttf b/resources/fonts/Inter_28pt-Bold.ttf new file mode 100644 index 0000000..14db994 Binary files /dev/null and b/resources/fonts/Inter_28pt-Bold.ttf differ diff --git a/resources/fonts/inter.ttf b/resources/fonts/inter.ttf new file mode 100644 index 0000000..e31b51e Binary files /dev/null and b/resources/fonts/inter.ttf differ diff --git a/src/button.h b/src/button.h index 383bb7a..cc924e3 100644 --- a/src/button.h +++ b/src/button.h @@ -69,7 +69,8 @@ inline bool ViSegButton(Vec2Df mp, float x, float y, float start_angle, float en inline void DrawCenteredText(std::string text, Vec2Df position, float text_size, Color color){ float offset = MeasureText(text.c_str(), text_size); - DrawText(text.c_str(), position.x-offset/2.0f, position.y-text_size/2.0f, text_size, color); + //DrawText(text.c_str(), position.x-offset/2.0f, position.y-text_size/2.0f, text_size, color); + DrawTextEx(VISEQ::APP::inter, text.c_str(), Vec2Df(position.x-offset/2.0f, position.y-(float)text_size/2.0f+1), text_size, 2.0f, color); } inline void DrawText(std::string text, Vec2Df position, float text_size, Color color){ diff --git a/src/datatypes.h b/src/datatypes.h index 44ca79b..739fe0f 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -30,6 +30,10 @@ using json = nlohmann::json; #define RANGE_FILTER(L) std::ranges::views::filter(L) +namespace VISEQ::APP{ + inline Font inter; +} + namespace VISEQ::TEXTURES { inline Texture2D tex_connector; inline Texture2D tex_connector_hover; diff --git a/src/midi-node.cpp b/src/midi-node.cpp index 6bbb774..2fe1f39 100644 --- a/src/midi-node.cpp +++ b/src/midi-node.cpp @@ -274,7 +274,7 @@ namespace VISEQ::GRAPH::NODES { VMATH::Vec2D desc_position = position + VMATH::Vec2D(radius + 7.0f, radius + 7.0f); switch(mode){ case NOTE:{ - if(!KEYS_DOWN.shift && !KEYS_DOWN.alt) DrawCenteredText(MIDI::Notes[getNotes().note], position, 12, VS_COLOR_BLACK); + if(!KEYS_DOWN.shift && !KEYS_DOWN.alt) DrawCenteredText(MIDI::Notes[getNotes().note], position, 14, VS_COLOR_BLACK); if(!KEYS_DOWN.ctrl && KEYS_DOWN.shift && !KEYS_DOWN.alt) DrawCenteredText(std::format("{}", getNotes().velocity), position, 12, VS_COLOR_BLACK); if(!KEYS_DOWN.ctrl && !KEYS_DOWN.shift && KEYS_DOWN.alt) DrawCenteredText(std::format("{:.1f}s", (float)getNotes().gate / 1000.f), position, 12, VS_COLOR_BLACK); diff --git a/src/ui.cpp b/src/ui.cpp index 17422ee..458acbd 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -6,6 +6,7 @@ #include "raygui/raygui.h" #include "datatypes.h" +#include "vmath.h" #include #include @@ -14,6 +15,7 @@ namespace VISEQ::APP::UI{ void AppUI::init(){ GuiLoadStyleDark(); + inter = LoadFontEx("resources/fonts/Inter_28pt-Bold.ttf", 96, 0, 250); } void AppUI::drawSideBar(){ @@ -105,7 +107,8 @@ namespace VISEQ::APP::UI{ void AppUI::DrawCenteredText(std::string text, Vec2Df position, int size, Color color){ float offset = MeasureText(text.c_str(), size); - DrawText(text.c_str(), position.x-offset/2.0f, position.y-(float)size/2.0f+1, size, color ); + //DrawText(text.c_str(), position.x-offset/2.0f, position.y-(float)size/2.0f+1, size, color ); + DrawTextEx(inter, text.c_str(), Vec2Df(position.x-offset/2.0f, position.y-(float)size/2.0f+1), size, 2.0f, color); } void AppUI::drawContextMenu(Camera2D camera){