Embed Arimo font.

This commit is contained in:
Bartosz Taudul 2018-07-28 01:03:26 +02:00
parent 31c2ddb8ac
commit b7ec7f6819
4 changed files with 6587 additions and 18 deletions

View File

@ -147,6 +147,7 @@
<ClInclude Include="..\..\..\server\tracy_pdqsort.h" />
<ClInclude Include="..\..\libs\gl3w\GL\gl3w.h" />
<ClInclude Include="..\..\libs\gl3w\GL\glcorearb.h" />
<ClInclude Include="..\..\src\Arimo.hpp" />
<ClInclude Include="..\..\src\imgui_impl_glfw_gl3.h" />
</ItemGroup>
<ItemGroup>

View File

@ -182,6 +182,9 @@
<ClInclude Include="..\..\..\common\TracyMutex.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\Arimo.hpp">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Natvis Include="DebugVis.natvis" />

6574
standalone/src/Arimo.hpp Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@
#include "../../server/TracyFileRead.hpp"
#include "../../server/TracyView.hpp"
#include "Arimo.hpp"
static void glfw_error_callback(int error, const char* description)
{
fprintf(stderr, "Error %d: %s\n", error, description);
@ -77,25 +79,14 @@ int main( int argc, char** argv )
ImGui::CreateContext();
ImGui_ImplGlfwGL3_Init(window, true);
// Load Fonts
// (there is a default font, this is only if you want to change it. see extra_fonts/README.txt for more details)
//ImGuiIO& io = ImGui::GetIO();
//io.Fonts->AddFontDefault();
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/Cousine-Regular.ttf", 15.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/DroidSans.ttf", 16.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyClean.ttf", 13.0f);
//io.Fonts->AddFontFromFileTTF("../../extra_fonts/ProggyTiny.ttf", 10.0f);
//io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesJapanese());
static const ImWchar ranges[] = {
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x03BC, 0x03BC, // micro
0,
};
{
const char* font = "c:\\Windows\\Fonts\\arial.ttf";
struct stat st;
if( stat( font, &st ) == 0 )
{
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontFromFileTTF( font, 15.0f * dpiScale );
}
}
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Arimo_compressed_data, tracy::Arimo_compressed_size, 15.0f * dpiScale, nullptr, ranges );
ImGui::StyleColorsDark();
auto& style = ImGui::GetStyle();