mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-23 01:00:54 +00:00
Add CJK font.
This commit is contained in:
@@ -186,6 +186,7 @@ Embed(PROFILER_FILES FontBold src/font/Roboto-Bold.ttf)
|
||||
Embed(PROFILER_FILES FontItalic src/font/Roboto-Italic.ttf)
|
||||
Embed(PROFILER_FILES FontBoldItalic src/font/Roboto-BoldItalic.ttf)
|
||||
Embed(PROFILER_FILES FontEmoji src/font/NotoEmoji-Regular.ttf)
|
||||
Embed(PROFILER_FILES FontCjk src/font/SourceHanSans-Normal.ttc)
|
||||
set(MANUAL_MD ${CMAKE_CURRENT_BINARY_DIR}/manual/tracy.md)
|
||||
add_custom_command(
|
||||
OUTPUT ${MANUAL_MD}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "data/FontBoldItalic.hpp"
|
||||
#include "data/FontItalic.hpp"
|
||||
#include "data/FontEmoji.hpp"
|
||||
#include "data/FontCjk.hpp"
|
||||
|
||||
FontData g_fonts;
|
||||
|
||||
@@ -41,28 +42,34 @@ void LoadFonts( float scale )
|
||||
static auto fontBoldItalic = Unembed( FontBoldItalic );
|
||||
static auto fontItalic = Unembed( FontItalic );
|
||||
static auto fontEmoji = Unembed( FontEmoji );
|
||||
static auto fontCjk = Unembed( FontCjk );
|
||||
|
||||
io.Fonts->Clear();
|
||||
|
||||
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*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontCjk->data(), fontCjk->size(), round( 19.0f * scale ), &configMerge );
|
||||
|
||||
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*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontCjk->data(), fontCjk->size(), round( 19.0f * scale ), &configMerge );
|
||||
|
||||
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*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontCjk->data(), fontCjk->size(), round( 19.0f * scale ), &configMerge );
|
||||
|
||||
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*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontCjk->data(), fontCjk->size(), round( 19.0f * scale ), &configMerge );
|
||||
|
||||
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*)fontEmoji->data(), fontEmoji->size(), round( 14.0f * scale ), &configMerge );
|
||||
io.Fonts->AddFontFromMemoryTTF( (void*)fontCjk->data(), fontCjk->size(), round( 19.0f * scale ), &configMerge );
|
||||
|
||||
FontNormal = round( scale * 15.f );
|
||||
FontSmall = round( scale * 15 * 2.f / 3.f );
|
||||
|
||||
BIN
profiler/src/font/SourceHanSans-Normal.ttc
Normal file
BIN
profiler/src/font/SourceHanSans-Normal.ttc
Normal file
Binary file not shown.
Reference in New Issue
Block a user