By default during initialization the particular locations of fonts for the system the Coherent GT is run on are traversed gathering and caching info for each font. This may sometimes lead to unneeded delay. If the fonts used by the application are stored in a specific folder this path can be pointed as the only source of font data.
The following options are available for using specific fonts:
false
.Coherent::UIGT::SystemSettings settings; settings.LoadSystemFonts = false; UISystem = InitializeUIGTSystem(COHERENT_UI_GT_LICENSE, settings, Coherent::LoggingGT::Debug, &LogHandler);
@font-face
. Loading the font will be done asynchronously and during that time GT will attempt to use a default font - usually Arial. Since Arial is missing the application may break.UISystem->AddFontsFolder("./SampleFonts");
std::ifstream fontInput("loaded_fonts/times.ttf", std::ios::binary); fontInput.seekg(0, std::ios::end); std::streamsize size = fontInput.tellg(); fontInput.seekg(0, std::ios::beg); static std::vector<char> buffer(size); if (fontInput.read(buffer.data(), size)) { UISystem->AddFont(buffer.data(), size); } fontInput.close();