Switched to Roboto font. Added mono font.

This commit is contained in:
Branimir Karadžić
2016-05-28 16:26:12 -07:00
parent 3dd6bc237b
commit dda0de635e
12 changed files with 16248 additions and 36 deletions

View File

@@ -48,7 +48,7 @@
#include "fs_imgui_image_swizz.bin.h"
// embedded font
#include "droidsans.ttf.h"
#include "roboto_regular.ttf.h"
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4244); // warning C4244: '=' : conversion from '' to '', possible loss of data
@@ -451,7 +451,7 @@ struct Imgui
return bgfx::createTexture2D(uint16_t(_width), uint16_t(_height), 0, bgfx::TextureFormat::BGRA8, 0, mem);
}
ImguiFontHandle create(const void* _data, uint32_t _size, float _fontSize, bx::AllocatorI* _allocator)
ImguiFontHandle create(float _fontSize, bx::AllocatorI* _allocator)
{
m_allocator = _allocator;
@@ -463,16 +463,10 @@ struct Imgui
}
#endif // BX_CONFIG_ALLOCATOR_CRT
if (NULL == _data)
{
_data = s_droidSansTtf;
_size = sizeof(s_droidSansTtf);
}
IMGUI_create(_data, _size, _fontSize, m_allocator);
IMGUI_create(_fontSize, m_allocator);
m_nvg = nvgCreate(1, m_view, m_allocator);
nvgCreateFontMem(m_nvg, "default", (unsigned char*)_data, INT32_MAX, 0);
nvgCreateFontMem(m_nvg, "default", (unsigned char*)s_robotoRegularTtf, INT32_MAX, 0);
nvgFontSize(m_nvg, _fontSize);
nvgFontFace(m_nvg, "default");
@@ -606,7 +600,7 @@ struct Imgui
m_missingTexture = genMissingTexture(256, 256, 0.04f);
#if !USE_NANOVG_FONT
const ImguiFontHandle handle = createFont(_data, _fontSize);
const ImguiFontHandle handle = createFont(s_robotoRegularTtf, _fontSize);
m_currentFontIdx = handle.idx;
#else
const ImguiFontHandle handle = { bgfx::invalidHandle };
@@ -3262,9 +3256,9 @@ void imguiFree(void* _ptr, void*)
BX_FREE(s_imgui.m_allocator, _ptr);
}
ImguiFontHandle imguiCreate(const void* _data, uint32_t _size, float _fontSize, bx::AllocatorI* _allocator)
ImguiFontHandle imguiCreate(const void*, uint32_t, float _fontSize, bx::AllocatorI* _allocator)
{
return s_imgui.create(_data, _size, _fontSize, _allocator);
return s_imgui.create(_fontSize, _allocator);
}
void imguiDestroy()