0

When run cobalt, it will crash as follows, it seemed there need some font files, so what fonts does it need and where to put them?:

Caught signal: SIGSEGV(11)
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
SkFontMgr_CobaltDefaultFont() [0xcc6204]
.....

1 Answers1

0

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;
    }
bitchainer
  • 535
  • 2
  • 19
  • Yeah, it works, as I moved the cobalt from build out directory to another place and run it, but there is no content file yet. –  Feb 10 '17 at 03:00