%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
import { Asset } from 'expo-asset'; import Constants from 'expo-constants'; import { CodedError, Platform } from 'expo-modules-core'; import ExpoFontLoader from './ExpoFontLoader'; const isInExpoGo = Constants.appOwnership === 'expo'; export function fontFamilyNeedsScoping(name) { return (isInExpoGo && Platform.OS !== 'ios' && !Constants.systemFonts.includes(name) && name !== 'System' && !name.includes(Constants.sessionId)); } export function getAssetForSource(source) { if (source instanceof Asset) { return source; } if (typeof source === 'string') { return Asset.fromURI(source); } else if (typeof source === 'number') { return Asset.fromModule(source); } else if (typeof source === 'object' && typeof source.uri !== 'undefined') { return getAssetForSource(source.uri); } // @ts-ignore Error: Type 'string' is not assignable to type 'Asset' // We can't have a string here, we would have thrown an error if !isWeb // or returned Asset.fromModule if isWeb. return source; } export async function loadSingleFontAsync(name, input) { const asset = input; if (!asset.downloadAsync) { throw new CodedError(`ERR_FONT_SOURCE`, '`loadSingleFontAsync` expected resource of type `Asset` from expo-asset on native'); } await asset.downloadAsync(); if (!asset.downloaded) { throw new CodedError(`ERR_DOWNLOAD`, `Failed to download asset for font "${name}"`); } await ExpoFontLoader.loadAsync(getNativeFontName(name), asset.localUri); } export function getNativeFontName(name) { if (fontFamilyNeedsScoping(name)) { return `${Constants.sessionId}-${name}`; } else { return name; } } //# sourceMappingURL=FontLoader.js.map