From 711771bc27f1741f85d1c80da59bc79b2d7970d3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 5 Jan 2026 13:35:51 +0100 Subject: [PATCH] Replace narrow no-break space with no-break space in markdown text. Nemotron 3 Nano outputs these spaces in the text. The currently used font (or is it ImGui?) is not able to render this, and draws replacement character instead. --- profiler/src/profiler/TracyImGui.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/profiler/src/profiler/TracyImGui.cpp b/profiler/src/profiler/TracyImGui.cpp index 06284bbf..528d86c3 100644 --- a/profiler/src/profiler/TracyImGui.cpp +++ b/profiler/src/profiler/TracyImGui.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "TracyPrint.hpp" #include "TracyImGui.hpp" @@ -131,7 +132,18 @@ bool PrintTextWrapped( const char* text, const char* end ) { bool hovered = false; + // Replace narrow no-break space with no-break space if( !end ) end = text + strlen( text ); + std::string buf( text, end ); + auto found = buf.find( "\xe2\x80\xaf" ); + while( found != std::string::npos ) + { + buf.replace( found, 3, "\xc2\xa0" ); + found = buf.find( "\xe2\x80\xaf", found ); + } + text = buf.c_str(); + end = text + buf.size(); + auto firstWord = text; while( firstWord < end && *firstWord != ' ' && *firstWord != '\n' ) firstWord++;