(fontDescriptor: FontDescriptor)
| 18 | const uiFontCache = new Map<string, UIFont>(); |
| 19 | |
| 20 | function computeFontCacheKey(fontDescriptor: FontDescriptor) { |
| 21 | const { fontFamily, fontSize, fontWeight, fontVariationSettings, isBold, isItalic } = fontDescriptor; |
| 22 | const sep = ':'; |
| 23 | return [fontFamily.join(sep), fontSize, fontWeight, String(FontVariationSettings.toString(fontVariationSettings)).replace(/'/g, '').replace(/[\s,]/g, '_'), isBold, isItalic].join(sep); |
| 24 | } |
| 25 | |
| 26 | function getUIFontCached(fontDescriptor: FontDescriptor) { |
| 27 | const cacheKey = computeFontCacheKey(fontDescriptor); |
no test coverage detected