| 42 | } |
| 43 | |
| 44 | void 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 |
no test coverage detected