You can check the backtrace of crash, and you will find it need to get the font from content/data/fonts
when you run Cobalt, and content/data/fonts
is created after building done Cobalt in the out/linux-x11directfb_qa/content/data/fonts(x11 directfb build)
, so you need to copy the whole content file from out/linux-x11directfb_qa/
to the place where your cobalt binary laid.
https://cobalt.googlesource.com/cobalt/+/e9b4b99dab6e774b8b6e63add74c352cc5dd395a/src/starboard/linux/shared/system_get_path.cc
bool SbSystemGetPath(SbSystemPathId path_id, char* out_path, int path_size) {
if (!out_path || !path_size) {
return false;
}
const int kPathSize = PATH_MAX;
char path[kPathSize];
path[0] = '\0';
switch (path_id) {
case kSbSystemPathContentDirectory: {
if (!GetExecutableDirectory(path, kPathSize)) {
return false;
}
if (SbStringConcat(path, "/content/data", kPathSize) >= kPathSize) {
return false;
}
break;
}