Do not crash if default font cant be loaded
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
649773c851
commit
588f316fd6
1 changed files with 4 additions and 2 deletions
|
@ -112,6 +112,7 @@ void WindowInit(Window* const window, DISTRHO_NAMESPACE::UI* const ui)
|
||||||
|
|
||||||
// Load default Blendish font
|
// Load default Blendish font
|
||||||
window->uiFont = window->loadFont(asset::system("res/fonts/DejaVuSans.ttf"));
|
window->uiFont = window->loadFont(asset::system("res/fonts/DejaVuSans.ttf"));
|
||||||
|
if (window->uiFont != nullptr)
|
||||||
bndSetFont(window->uiFont->handle);
|
bndSetFont(window->uiFont->handle);
|
||||||
|
|
||||||
// Init settings
|
// Init settings
|
||||||
|
@ -167,6 +168,7 @@ void Window::step() {
|
||||||
// Make event handlers and step() have a clean NanoVG context
|
// Make event handlers and step() have a clean NanoVG context
|
||||||
// nvgReset(vg);
|
// nvgReset(vg);
|
||||||
|
|
||||||
|
if (uiFont != nullptr)
|
||||||
bndSetFont(uiFont->handle);
|
bndSetFont(uiFont->handle);
|
||||||
|
|
||||||
// Set window title
|
// Set window title
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue