File tree Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Expand file tree Collapse file tree 3 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ set(CASPARCG_DOWNLOAD_CACHE ${CMAKE_CURRENT_BINARY_DIR}/external CACHE STRING "D
12
12
13
13
option (ENABLE_HTML "Enable HTML module, require CEF" ON )
14
14
15
+ set (DIAG_FONT_PATH "LiberationMono-Regular.ttf" CACHE STRING
16
+ "Path to font that will be used to load diag font at runtime. By default
17
+ this loads the font distribtued with the application from the working
18
+ directory. It can be set to an absolute path to instead load a font from
19
+ the system."
20
+ )
21
+ add_compile_definitions ("DIAG_FONT_PATH=\" ${DIAG_FONT_PATH} \" " )
22
+
15
23
# Add custom cmake modules path
16
24
SET (CASPARCG_PATCH_DIR ${CMAKE_SOURCE_DIR} /CMakeModules/patches )
17
25
LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} /CMakeModules )
Original file line number Diff line number Diff line change @@ -114,10 +114,6 @@ if (NOT USE_STATIC_BOOST)
114
114
ADD_DEFINITIONS (-DBOOST_ALL_DYN_LINK )
115
115
endif ()
116
116
117
- if (USE_SYSTEM_DIAG_FONT )
118
- ADD_DEFINITIONS (-DUSE_SYSTEM_DIAG_FONT )
119
- endif ()
120
-
121
117
IF (NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
122
118
ADD_COMPILE_OPTIONS (-O3 ) # Needed for precompiled headers to work
123
119
endif ()
Original file line number Diff line number Diff line change @@ -66,14 +66,8 @@ sf::Font& get_default_font()
66
66
{
67
67
static sf::Font DEFAULT_FONT = []() {
68
68
sf::Font font;
69
- #ifdef USE_SYSTEM_DIAG_FONT
70
- if (!font.loadFromFile (" /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf" ))
71
- CASPAR_THROW_EXCEPTION (file_not_found () << msg_info (
72
- " /usr/share/fonts/truetype/liberation/LiberationMono-Regular.ttf not found" ));
73
- #else
74
- if (!font.loadFromFile (" LiberationMono-Regular.ttf" ))
75
- CASPAR_THROW_EXCEPTION (file_not_found () << msg_info (" LiberationMono-Regular.ttf not found" ));
76
- #endif
69
+ if (!font.loadFromFile (DIAG_FONT_PATH))
70
+ CASPAR_THROW_EXCEPTION (file_not_found () << msg_info (DIAG_FONT_PATH " not found" ));
77
71
return font;
78
72
}();
79
73
You can’t perform that action at this time.
0 commit comments