Merge font awesome into the default font.

This commit is contained in:
Bartosz Taudul 2018-08-17 17:56:55 +02:00
parent 337111f948
commit 3d0b9da592
3 changed files with 14 additions and 3 deletions

View File

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

View File

@ -206,6 +206,9 @@
<ClInclude Include="..\..\..\imguicolortextedit\TextEditor.h">
<Filter>imguicolortextedit</Filter>
</ClInclude>
<ClInclude Include="..\..\src\FontAwesomeSolid.hpp">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Natvis Include="DebugVis.natvis" />

View File

@ -21,8 +21,8 @@
#include "../../server/TracyWorker.hpp"
#include "../../server/TracyVersion.hpp"
#include "Arimo.hpp"
#include "FontAwesomeSolid.hpp"
static void glfw_error_callback(int error, const char* description)
{
@ -97,14 +97,21 @@ int main( int argc, char** argv )
ImGui::CreateContext();
ImGui_ImplGlfwGL3_Init(window, true);
static const ImWchar ranges[] = {
static const ImWchar rangesBasic[] = {
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x03BC, 0x03BC, // micro
0,
};
static const ImWchar rangesIcons[] = {
0xF071, 0xF071,
0
};
ImFontConfig configMerge;
configMerge.MergeMode = true;
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Arimo_compressed_data, tracy::Arimo_compressed_size, 15.0f * dpiScale, nullptr, ranges );
io.Fonts->AddFontFromMemoryCompressedTTF( tracy::Arimo_compressed_data, tracy::Arimo_compressed_size, 15.0f * dpiScale, nullptr, rangesBasic );
io.Fonts->AddFontFromMemoryCompressedTTF( tracy::FontAwesomeSolid_compressed_data, tracy::FontAwesomeSolid_compressed_size, 15.0f * dpiScale, &configMerge, rangesIcons );
auto fixedWidth = io.Fonts->AddFontDefault();
ImGui::StyleColorsDark();