mirror of
https://github.com/wolfpld/tracy.git
synced 2026-01-18 17:11:26 +01:00
Add emoji font.
This commit is contained in:
@@ -160,6 +160,7 @@ add_library(TracyImGui STATIC EXCLUDE_FROM_ALL ${IMGUI_SOURCES})
|
|||||||
target_include_directories(TracyImGui PUBLIC ${ImGui_SOURCE_DIR})
|
target_include_directories(TracyImGui PUBLIC ${ImGui_SOURCE_DIR})
|
||||||
target_link_libraries(TracyImGui PUBLIC TracyFreetype)
|
target_link_libraries(TracyImGui PUBLIC TracyFreetype)
|
||||||
target_compile_definitions(TracyImGui PRIVATE "IMGUI_ENABLE_FREETYPE")
|
target_compile_definitions(TracyImGui PRIVATE "IMGUI_ENABLE_FREETYPE")
|
||||||
|
target_compile_definitions(TracyImGui PUBLIC "IMGUI_USE_WCHAR32")
|
||||||
#target_compile_definitions(TracyImGui PUBLIC "IMGUI_DISABLE_OBSOLETE_FUNCTIONS")
|
#target_compile_definitions(TracyImGui PUBLIC "IMGUI_DISABLE_OBSOLETE_FUNCTIONS")
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LEGACY)
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND LEGACY)
|
||||||
|
|||||||
@@ -4228,3 +4228,5 @@ The following libraries are included with and used by the Tracy Profiler. Entrie
|
|||||||
- Fira Code -- <https://github.com/tonsky/FiraCode>
|
- Fira Code -- <https://github.com/tonsky/FiraCode>
|
||||||
|
|
||||||
- Font Awesome -- <https://fontawesome.com/>
|
- Font Awesome -- <https://fontawesome.com/>
|
||||||
|
|
||||||
|
- Noto Emoji -- <https://github.com/googlefonts/noto-emoji>
|
||||||
|
|||||||
@@ -4982,6 +4982,7 @@ The following libraries are included with and used by the Tracy Profiler. Entrie
|
|||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item Fira Code -- \url{https://github.com/tonsky/FiraCode}
|
\item Fira Code -- \url{https://github.com/tonsky/FiraCode}
|
||||||
\item Font Awesome -- \url{https://fontawesome.com/}
|
\item Font Awesome -- \url{https://fontawesome.com/}
|
||||||
|
\item Noto Emoji -- \url{https://github.com/googlefonts/noto-emoji}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ Embed(PROFILER_FILES FontNormal src/font/Roboto-Regular.ttf)
|
|||||||
Embed(PROFILER_FILES FontBold src/font/Roboto-Bold.ttf)
|
Embed(PROFILER_FILES FontBold src/font/Roboto-Bold.ttf)
|
||||||
Embed(PROFILER_FILES FontItalic src/font/Roboto-Italic.ttf)
|
Embed(PROFILER_FILES FontItalic src/font/Roboto-Italic.ttf)
|
||||||
Embed(PROFILER_FILES FontBoldItalic src/font/Roboto-BoldItalic.ttf)
|
Embed(PROFILER_FILES FontBoldItalic src/font/Roboto-BoldItalic.ttf)
|
||||||
|
Embed(PROFILER_FILES FontEmoji src/font/NotoEmoji-Regular.ttf)
|
||||||
Embed(PROFILER_FILES Manual ../manual/tracy.md)
|
Embed(PROFILER_FILES Manual ../manual/tracy.md)
|
||||||
|
|
||||||
set(INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
set(INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "data/FontBold.hpp"
|
#include "data/FontBold.hpp"
|
||||||
#include "data/FontBoldItalic.hpp"
|
#include "data/FontBoldItalic.hpp"
|
||||||
#include "data/FontItalic.hpp"
|
#include "data/FontItalic.hpp"
|
||||||
|
#include "data/FontEmoji.hpp"
|
||||||
|
|
||||||
FontData g_fonts;
|
FontData g_fonts;
|
||||||
|
|
||||||
@@ -40,23 +41,29 @@ void LoadFonts( float scale )
|
|||||||
auto fontBold = Unembed( FontBold );
|
auto fontBold = Unembed( FontBold );
|
||||||
auto fontBoldItalic = Unembed( FontBoldItalic );
|
auto fontBoldItalic = Unembed( FontBoldItalic );
|
||||||
auto fontItalic = Unembed( FontItalic );
|
auto fontItalic = Unembed( FontItalic );
|
||||||
|
auto fontEmoji = Unembed( FontEmoji );
|
||||||
|
|
||||||
io.Fonts->Clear();
|
io.Fonts->Clear();
|
||||||
|
|
||||||
g_fonts.normal = io.Fonts->AddFontFromMemoryTTF( (void*)fontNormal->data(), fontNormal->size(), round( 15.0f * scale ), &configBasic );
|
g_fonts.normal = io.Fonts->AddFontFromMemoryTTF( (void*)fontNormal->data(), fontNormal->size(), round( 15.0f * scale ), &configBasic );
|
||||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
|
||||||
g_fonts.mono = io.Fonts->AddFontFromMemoryTTF( (void*)fontFixed->data(), fontFixed->size(), round( 15.0f * scale ), &configFixed );
|
g_fonts.mono = io.Fonts->AddFontFromMemoryTTF( (void*)fontFixed->data(), fontFixed->size(), round( 15.0f * scale ), &configFixed );
|
||||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
|
||||||
g_fonts.bold = io.Fonts->AddFontFromMemoryTTF( (void*)fontBold->data(), fontBold->size(), round( 15.0f * scale ), &configBasic );
|
g_fonts.bold = io.Fonts->AddFontFromMemoryTTF( (void*)fontBold->data(), fontBold->size(), round( 15.0f * scale ), &configBasic );
|
||||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
|
||||||
g_fonts.boldItalic = io.Fonts->AddFontFromMemoryTTF( (void*)fontBoldItalic->data(), fontBoldItalic->size(), round( 15.0f * scale ), &configBasic );
|
g_fonts.boldItalic = io.Fonts->AddFontFromMemoryTTF( (void*)fontBoldItalic->data(), fontBoldItalic->size(), round( 15.0f * scale ), &configBasic );
|
||||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
|
||||||
g_fonts.italic = io.Fonts->AddFontFromMemoryTTF( (void*)fontItalic->data(), fontItalic->size(), round( 15.0f * scale ), &configBasic );
|
g_fonts.italic = io.Fonts->AddFontFromMemoryTTF( (void*)fontItalic->data(), fontItalic->size(), round( 15.0f * scale ), &configBasic );
|
||||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontIcons->data(), fontIcons->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
io.Fonts->AddFontFromMemoryTTF( (void*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||||
|
|
||||||
FontNormal = round( scale * 15.f );
|
FontNormal = round( scale * 15.f );
|
||||||
FontSmall = round( scale * 15 * 2.f / 3.f );
|
FontSmall = round( scale * 15 * 2.f / 3.f );
|
||||||
|
|||||||
BIN
profiler/src/font/NotoEmoji-Regular.ttf
Normal file
BIN
profiler/src/font/NotoEmoji-Regular.ttf
Normal file
Binary file not shown.
Reference in New Issue
Block a user