打开页面后报错:
[0601/102941.544:ERROR:platform_font_skia.cc(343)] Could not find any font: Microsoft YaHei UI, sans. Falling back to the default
尝试的解决方法 打开内嵌页面仍会导致系统奔溃:
CefSettings settings;
CefRefPtr<CefCommandLine> cmd_line = CefCommandLine::CreateCommandLine();
cmd_line->AppendSwitchWithValue("disable-reading-from-canvas", "true");
settings.command_line_args_disabled = true;
CefMainArgs args;
CefInitialize(args, settings, nullptr, nullptr);
编译环境:MinGW
安装微软雅黑字体
这个错误是由于Skia图形引擎在渲染字体时无法找到“Microsoft YaHei UI”这种字体,从而导致使用默认字体。
1、安装“Microsoft YaHei UI”字体。你可以从多个来源(如Microsoft官方网站或第三方网站)下载该字体并进行安装。
2、更改应用程序中所使用的字体。你使用的“Microsoft YaHei UI”字体,更改为其他字体,比如“SimSun”或“Arial”。