MCPcopy Create free account
hub / github.com/Tencent/tgfx / registerFonts

Method registerFonts

web/demo/src/TGFXThreadsView.cpp:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void TGFXThreadsView::registerFonts(const val& fontVal, const val& emojiFontVal) {
45 auto fontData = GetDataFromEmscripten(fontVal);
46 if (fontData) {
47 auto typeface = tgfx::Typeface::MakeFromData(fontData, 0);
48 if (typeface) {
49 appHost->addTypeface("default", std::move(typeface));
50 }
51 }
52 auto emojiFontData = GetDataFromEmscripten(emojiFontVal);
53 if (emojiFontData) {
54 auto typeface = tgfx::Typeface::MakeFromData(emojiFontData, 0);
55 if (typeface) {
56 appHost->addTypeface("emoji", std::move(typeface));
57 }
58 }
59}
60
61} // namespace hello2d

Callers 1

index.tsFile · 0.80

Calls 2

GetDataFromEmscriptenFunction · 0.85
addTypefaceMethod · 0.80

Tested by

no test coverage detected