16
src/App.cpp
16
src/App.cpp
@@ -5,6 +5,8 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
#include <poll.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
@@ -300,7 +302,19 @@ auto App::init_egl() -> void
|
||||
m_tr = TextRenderer();
|
||||
auto const font = find_font_path();
|
||||
assert(font && "Could not find font");
|
||||
auto const font_handle = m_tr->load_font(*font);
|
||||
std::vector<std::filesystem::path> fallback_paths;
|
||||
constexpr char const *fallback_candidates[] = {
|
||||
"Noto Sans CJK JP:style=Regular",
|
||||
"Noto Sans CJK SC:style=Regular",
|
||||
"Noto Sans CJK KR:style=Regular",
|
||||
"Noto Sans CJK TC:style=Regular",
|
||||
};
|
||||
for (auto const *name : fallback_candidates) {
|
||||
if (auto fallback = find_font_path(name))
|
||||
fallback_paths.push_back(*fallback);
|
||||
}
|
||||
auto const font_handle
|
||||
= m_tr->load_font(*font, std::span(fallback_paths));
|
||||
assert(font_handle && "Could not load font");
|
||||
m_font = *font_handle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user