diff --git a/server/TracyView.cpp b/server/TracyView.cpp index b84032af..c0b3b061 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -294,7 +294,7 @@ enum { MinFrameSize = 5 }; static View* s_instance = nullptr; -View::View( const char* addr ) +View::View( const char* addr, ImFont* fixedWidth ) : m_worker( addr ) , m_staticView( false ) , m_frameScale( 0 ) @@ -330,6 +330,7 @@ View::View( const char* addr ) , m_statSort( 0 ) , m_statSelf( false ) , m_namespace( Namespace::Full ) + , m_textEditorFont( fixedWidth ) { assert( s_instance == nullptr ); s_instance = this; @@ -340,7 +341,7 @@ View::View( const char* addr ) InitTextEditor(); } -View::View( FileRead& f ) +View::View( FileRead& f, ImFont* fixedWidth ) : m_worker( f ) , m_staticView( true ) , m_frameScale( 0 ) @@ -375,6 +376,7 @@ View::View( FileRead& f ) , m_statSort( 0 ) , m_statSelf( false ) , m_namespace( Namespace::Full ) + , m_textEditorFont( fixedWidth ) { assert( s_instance == nullptr ); s_instance = this; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 8845550a..89784e0c 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -15,6 +15,7 @@ #include "tracy_flat_hash_map.hpp" struct ImVec2; +struct ImFont; namespace tracy { @@ -42,9 +43,9 @@ class View }; public: - View() : View( "127.0.0.1" ) {} - View( const char* addr ); - View( FileRead& f ); + View( ImFont* fixedWidth = nullptr ) : View( "127.0.0.1", fixedWidth ) {} + View( const char* addr, ImFont* fixedWidth = nullptr ); + View( FileRead& f, ImFont* fixedWidth = nullptr ); ~View(); static bool Draw(); @@ -236,6 +237,7 @@ private: std::unique_ptr m_textEditor; const char* m_textEditorFile; + ImFont* m_textEditorFont; struct FindZone { enum : uint64_t { Unselected = std::numeric_limits::max() - 1 };