Home / Type/ FontProvider Type — astro Architecture

FontProvider Type — astro Architecture

Architecture documentation for the FontProvider type/interface in types.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  be2378bd_e47d_7318_77a6_19d7e8c82520["FontProvider"]
  0414cf8f_0404_f03b_316f_0d732aa66968["types.ts"]
  be2378bd_e47d_7318_77a6_19d7e8c82520 -->|defined in| 0414cf8f_0404_f03b_316f_0d732aa66968
  style be2378bd_e47d_7318_77a6_19d7e8c82520 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/types.ts lines 30–58

export interface FontProvider<
	TFamilyOptions extends Record<string, any> | undefined | never = never,
> {
	/**
	 * A unique name for the provider, used in logs and for identification.
	 */
	name: string;
	/**
	 * A serializable object, used for identification.
	 */
	config?: Record<string, any> | undefined;
	/**
	 * Optional callback, used to perform any initialization logic.
	 */
	init?: ((context: FontProviderInitContext) => Awaitable<void>) | undefined;
	/**
	 * Used to retrieve and return font face data based on the given options.
	 */
	resolveFont: (options: ResolveFontOptions<TFamilyOptions>) => Awaitable<
		| {
				fonts: Array<unifont.FontFaceData>;
		  }
		| undefined
	>;
	/**
	 * Optional callback, used to return the list of available font names.
	 */
	listFonts?: (() => Awaitable<Array<string> | undefined>) | undefined;
}

Frequently Asked Questions

What is the FontProvider type?
FontProvider is a type/interface in the astro codebase, defined in packages/astro/src/assets/fonts/types.ts.
Where is FontProvider defined?
FontProvider is defined in packages/astro/src/assets/fonts/types.ts at line 30.

Analyze Your Own Codebase

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

Try Supermodel Free