Repository: withastro/astro
File: packages/astro/src/assets/fonts/config.ts (TypeScript)

Code before:
	variationSettings: z.string().optional(),
});

const fallbacksSchema = z.object({
	/**
	 * @default `["sans-serif"]`
	 *
	 * An array of fonts to use when your chosen font is unavailable, or loading. Fallbacks are applied from left to right:
	 *
	 * ```js
	 * fallbacks: ["CustomFont", "serif"]
	 * ```
	 *
	 * If you don't want any fallbacks, use an empty array:
	 *
	 * ```js
	 * fallbacks: []
	 * ```
	 *
	 * If `optimizedFallbacks` is set to `true`, we look for the last fallback and check if it's a [generic family name](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name). If so, we try to generate an [optimized fallback](https://developer.chrome.com/blog/font-fallbacks) using font metrics.
	 */
	fallbacks: z.array(z.string()).nonempty().optional(),
	/**
	 * @default `true`
	 *
	 * Whether or not to enable optimized fallback generation. Enabling this should only be needed if you want full control over the `fallbacks`.
	 */
	optimizedFallbacks: z.boolean().optional(),
});

export const requiredFamilyAttributesSchema = z.object({
	/**
	 * The font family name, as identified by your font provider.
	 */
	name: z.string(),
	/**
	 * A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable.
	 */
	cssVariable: z.string(),
});

const entrypointSchema = z.union([z.string(), z.instanceof(URL)]);

export const fontProviderSchema = z
	.object({
		/**
		 * URL, path relative to the root or package import.
		 */
		entrypoint: entrypointSchema,
		/**
		 * Optional serializable object passed to the unifont provider.

Review comment (performance):
It's true by default, though right? So it *is* enabled, but we're saying it "should only be needed when.."

Did you mean to say, *dis*abling this should only be needed? Did you mean?

```suggestion
	 * Whether or not to enable optimized fallback generation. You may disable this default optimization to provide `fallbacks` font optimization yourself.
```
And, is this the idea? Like, it's not recommended so we say, "We won't optimize if you want us to move out of the way, but you'll have to do something yourself?"

Code after:
	variationSettings: z.string().optional(),
});

const fallbacksSchema = z.object({
	/**
	 * @default `["sans-serif"]`
	 *
	 * An array of fonts to use when your chosen font is unavailable, or loading. Fallback fonts will be chosen in the order listed. The first available font will be used:
	 *
	 * ```js
	 * fallbacks: ["CustomFont", "serif"]
	 * ```
	 *
	 * To disable fallback fonts completely, configure an empty array:
	 *
	 * ```js
	 * fallbacks: []
	 * ```
	 *

	 * If the last font in the `fallbacks` array is a [generic family name](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#generic-name), an [optimized fallback](https://developer.chrome.com/blog/font-fallbacks) using font metrics will be generated. To disable this optimization, set `optimizedFallbacks` to false.
	 */
	fallbacks: z.array(z.string()).nonempty().optional(),
	/**
	 * @default `true`
	 *
	 * Whether or not to enable optimized fallback generation. You may disable this default optimization to have full control over `fallbacks`.
	 */
	optimizedFallbacks: z.boolean().optional(),
});

export const requiredFamilyAttributesSchema = z.object({
	/**
	 * The font family name, as identified by your font provider.
	 */
	name: z.string(),
	/**
	 * A valid [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/ident) in the form of a CSS variable (i.e. starting with `--`).
	 */
	cssVariable: z.string(),
});

const entrypointSchema = z.union([z.string(), z.instanceof(URL)]);

export const fontProviderSchema = z
	.object({
		/**
		 * URL, path relative to the root or package import.
		 */
		entrypoint: entrypointSchema,
		/**