48 gSystem->ExpandPathName(fullname);
51 std::ifstream is(fullname.
Data(), std::ios::in | std::ios::binary);
54 is.seekg(0, std::ios::end);
55 res.resize(is.tellg());
56 is.seekg(0, std::ios::beg);
57 is.read((
char *)res.data(), res.length());
64 SetSrc(
TString::Format(
"url('data:application/font-%s;charset=utf-8;base64,%s') format('%s')", fmt.c_str(),
base64.Data(), fmt.c_str()).Data());
void SetSrc(const std::string &src)
Set src attribute of font-face directly Only for expert use.
void SetFile(const std::string &fname, const std::string &fmt="woff2")
Set font source as file content.
void SetUrl(const std::string &url, const std::string &fmt="woff2")
Set font source as URL.
std::string fSrc
font source, assigned as "src" attribute
static TString Encode(const char *data)
Transform data into a null terminated base64 string.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Namespace for ROOT features in testing.