Home / Function/ resolveFont() — astro Function Reference

resolveFont() — astro Function Reference

Architecture documentation for the resolveFont() function in unifont-font-resolver.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  40582598_ddaf_bc56_1d35_6346d14bd03c["resolveFont()"]
  e75025f8_1303_03ea_42ce_653194e50374["UnifontFontResolver"]
  40582598_ddaf_bc56_1d35_6346d14bd03c -->|defined in| e75025f8_1303_03ea_42ce_653194e50374
  585ad958_97bd_0d25_1b2b_d396c4fe2747["astroToUnifontProvider()"]
  585ad958_97bd_0d25_1b2b_d396c4fe2747 -->|calls| 40582598_ddaf_bc56_1d35_6346d14bd03c
  86803e41_45ca_a354_b3e0_fd9a88d03563["idFromProvider()"]
  40582598_ddaf_bc56_1d35_6346d14bd03c -->|calls| 86803e41_45ca_a354_b3e0_fd9a88d03563
  style 40582598_ddaf_bc56_1d35_6346d14bd03c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/infra/unifont-font-resolver.ts lines 94–119

	async resolveFont({
		familyName,
		provider,
		options,
		...rest
	}: ResolveFontOptions<Record<string, any>> & { provider: FontProvider }): Promise<
		Array<FontFaceData>
	> {
		const id = UnifontFontResolver.idFromProvider({
			hasher: this.#hasher,
			provider,
		});
		const { fonts } = await this.#unifont.resolveFont(
			familyName,
			{
				// Options are currently namespaced by provider name, it may change in
				// https://github.com/unjs/unifont/pull/287
				options: {
					[id]: options,
				},
				...rest,
			},
			[id],
		);
		return fonts;
	}

Domain

Subdomains

Frequently Asked Questions

What does resolveFont() do?
resolveFont() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/unifont-font-resolver.ts.
Where is resolveFont() defined?
resolveFont() is defined in packages/astro/src/assets/fonts/infra/unifont-font-resolver.ts at line 94.
What does resolveFont() call?
resolveFont() calls 1 function(s): idFromProvider.
What calls resolveFont()?
resolveFont() is called by 1 function(s): astroToUnifontProvider.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free