diff --git a/src/CMakeModules/Bootstrap_Linux.cmake b/src/CMakeModules/Bootstrap_Linux.cmake index 6fa4ecdb0b..7af7639a99 100644 --- a/src/CMakeModules/Bootstrap_Linux.cmake +++ b/src/CMakeModules/Bootstrap_Linux.cmake @@ -114,6 +114,10 @@ if (NOT USE_STATIC_BOOST) ADD_DEFINITIONS (-DBOOST_ALL_DYN_LINK) endif() +if (USE_SYSTEM_DIAG_FONT) + ADD_DEFINITIONS(-DUSE_SYSTEM_DIAG_FONT) +endif() + IF (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") ADD_COMPILE_OPTIONS (-O3) # Needed for precompiled headers to work endif() diff --git a/src/core/diagnostics/osd_graph.cpp b/src/core/diagnostics/osd_graph.cpp index 9dd6cd3c25..0a20c4d07d 100644 --- a/src/core/diagnostics/osd_graph.cpp +++ b/src/core/diagnostics/osd_graph.cpp @@ -66,8 +66,13 @@ sf::Font& get_default_font() { static sf::Font DEFAULT_FONT = []() { sf::Font font; +#ifdef USE_SYSTEM_DIAG_FONT + if (!font.loadFromFile("/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf")) + CASPAR_THROW_EXCEPTION(file_not_found() << msg_info("/usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf not found")); +#else if (!font.loadFromFile("LiberationMono-Regular.ttf")) CASPAR_THROW_EXCEPTION(file_not_found() << msg_info("LiberationMono-Regular.ttf not found")); +#endif return font; }();