| 341 | _fallbackFontFamilies[character] = fontFamily; |
| 342 | |
| 343 | return getFontFromFamily(guard, fontFamily, fontStyle, fontSize, scale, true); |
| 344 | } |
| 345 | |
| 346 | Valdi::Result<Ref<Font>> FontManager::getEmojiFont(Scalar fontSize, double scale) { |
| 347 | Character emoji = 0x270C; |
| 348 | return getCompatibleFont(String(), _defaultFontStyle, fontSize, scale, nullptr, 0, emoji); |
| 349 | } |
| 350 | |
| 351 | Ref<IFontManager> FontManager::makeScoped() { |
| 352 | return Valdi::makeShared<ScopedFontManager>(*getSkValue(), _logger, Valdi::strongSmallRef(this)); |
| 353 | } |
| 354 | |
| 355 | Valdi::Result<Valdi::Ref<Font>> FontManager::getFontFromFamily(std::unique_lock<Valdi::Mutex>& lock, |
| 356 | const Ref<FontFamily>& fontFamily, |
| 357 | FontStyle fontStyle, |
| 358 | Scalar fontSize, |
| 359 | double scale, |
| 360 | bool respectDynamicType) { |
| 361 | auto typeface = _typefaceRegistry.getTypefaceFromFamily(*_fontManager, fontFamily, fontStyle); |
| 362 | if (!typeface) { |
| 363 | return typeface.moveError(); |
| 364 | } |
| 365 | |
| 366 | return getFontWithTypefaceAndSize(lock, typeface.value(), fontSize, scale, respectDynamicType); |
| 367 | } |
| 368 | |
| 369 | Valdi::Result<Valdi::Ref<Font>> FontManager::getFontForName(const String& fontName, double scale) { |
| 370 | auto components = fontName.split(' ', true); |
| 371 | |
| 372 | if (components.size() == 1) { |
| 373 | auto guard = lock(); |
| 374 | if (components[0] == "title1") { |
no test coverage detected