diff --git a/src/index.ts b/src/index.ts index 319dec7..9e543a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,14 +62,15 @@ export async function createUnifont(providers: Provider[], options?: UnifontOpti const allProviders = Object.keys(stack) - async function resolveFont(fontFamily: string, options = defaultResolveOptions, providers = allProviders) { + async function resolveFont(fontFamily: string, options?: Partial, providers = allProviders) { + const mergedOptions = { ...defaultResolveOptions, ...options } for (const id of providers) { const provider = stack[id] if (!provider?.resolveFont) continue try { - const result = await provider.resolveFont(fontFamily, options) + const result = await provider.resolveFont(fontFamily, mergedOptions) if (result) { return { provider: id,