extract() — astro Function Reference
Architecture documentation for the extract() function in fontace-font-file-reader.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 84e7b905_21bb_442d_74e5_358c780fe37e["extract()"] 35f53ba2_577e_7db6_528c_de4c3cceba1e["FontaceFontFileReader"] 84e7b905_21bb_442d_74e5_358c780fe37e -->|defined in| 35f53ba2_577e_7db6_528c_de4c3cceba1e style 84e7b905_21bb_442d_74e5_358c780fe37e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/assets/fonts/infra/fontace-font-file-reader.ts lines 8–24
extract({ family, url }: { family: string; url: string }): { weight: string; style: Style } {
try {
const data = fontace(readFileSync(url));
return {
weight: data.weight,
style: data.style as Style,
};
} catch (cause) {
throw new AstroError(
{
...AstroErrorData.CannotDetermineWeightAndStyleFromFontFile,
message: AstroErrorData.CannotDetermineWeightAndStyleFromFontFile.message(family, url),
},
{ cause },
);
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does extract() do?
extract() is a function in the astro codebase, defined in packages/astro/src/assets/fonts/infra/fontace-font-file-reader.ts.
Where is extract() defined?
extract() is defined in packages/astro/src/assets/fonts/infra/fontace-font-file-reader.ts at line 8.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free