fonts.load
Registers each family's files, by the name fontFamily uses.
Verwendung
Register a downloaded font file with its weight.
// Register a downloaded font file with its weight.
import { fonts, type FontWeight } from 'kuito';
export async function registerHeadingFont(localFileURI: string) {
const weight: FontWeight = 700;
await fonts.load({ Heading: { uri: localFileURI, weight } });
}
// Pass a file:// URI, then use fontFamily="Heading" and fontWeight={700}.Signaturen
(fonts: Record<string, FontSource | readonly FontSource[]>): Promise<void>Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
fonts | Record<string, FontSource | readonly FontSource[]> | Ja | — |
Rückgabe
Promise<void>
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.