DiscussionsIssue archiveDraw Harness and Samples

Archived discussion

Is it possible to use Font_BRepFont in wasm?

Draw Harness and SamplesThu, 06/30/2022 - 13:001 reply

Browse this forum
QuestionAuthor

Hello.

Now I'm testing webgl build (emscripten wasm).

But It seems that there is no available font.

Font_FontMgr::GetInstance()->InitFontDataBase();
Font_NListOfSystemFont fontList = Font_FontMgr::GetInstance()->GetAvailableFonts();

printf("Start Listing..\n");
for (const auto& font : fontList) {
    printf("Available font: %s\n", font->FontName().ToCString()); // Nothing printed
}
printf("End Listing..\n");

How can I use the font functions in WebGL?

Discussion

1 archived reply

Posts are displayed in their archived order.

01Commenter-1

Browsers do not expose any font files to application, so you need to download your own fonts in compatible format (depends on FreeType build configuration) and register them within Font_FontMgr.