Ref Create() comments say that one should "set your Config before creating App".
|
/// Config before creating App. (@see Platform::set_config) |
However, as AppWin::AppWin() constructor overrides with Platform::instance().set_config, it has no effect.
|
Platform::instance().set_config(config); |
For example, if I load https://google.co.kr like below,
auto& platform = ultralight::Platform::instance();
Config config;
config.font_family_standard = "Malgun Gothic";
config.font_family_fixed = "Malgun Gothic";
config.font_family_serif = "Malgun Gothic";
config.font_family_sans_serif = "Malgun Gothic";
config.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
platform.set_config(config);
app_ = App::Create();
The result is like this:

The CORRECT way to setup config is,
app_ = App::Create();
auto& platform = ultralight::Platform::instance();
Config config;
config.font_family_standard = "Malgun Gothic";
config.font_family_fixed = "Malgun Gothic";
config.font_family_serif = "Malgun Gothic";
config.font_family_sans_serif = "Malgun Gothic";
config.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
platform.set_config(config);
app_->renderer() = Renderer::Create(); //this overides default config with 'my' config
which leads to Chrome-like correctly rendered scene.

Ref Create() comments say that one should "set your Config before creating App".
AppCore/include/AppCore/App.h
Line 51 in 0dfc793
However, as AppWin::AppWin() constructor overrides with Platform::instance().set_config, it has no effect.
AppCore/src/win/AppWin.cpp
Line 23 in 0dfc793
For example, if I load https://google.co.kr like below,
The result is like this:

The CORRECT way to setup config is,
which leads to Chrome-like correctly rendered scene.
