/home/user/html
in which are files
NotoSerif-Bold.ttf
NotoSerif-BoldItalic.ttf
NotoSerif-Italic.ttf
NotoSerif-Regular.ttf
My code for it:
- Code: Select all
CefRefPtr<CefFrame> frame = browser->GetMainFrame();
frame->LoadURL("file:///home/user/html/");
frame->LoadString(
R"(
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
@font-face {
font-family: 'NotoSerif';
src: url('NotoSerif-Regular.ttf');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'NotoSerif';
}
</style>
</head>
<body>
<h1>Test 12345 ⌐ἔγραψα¬</h1>
</body>
</html>
)",
"about:blank");
Then the html text with its font is loaded correctly.
Is code correct? Or how can I assign the base URL for the html text?