wrapper of experimental queryLocalFonts API
import {
isSupportQueryLocalFonts,
queryFontList,
queryTargetFontBlob,
} from 'local-font'
if (isSupportQueryLocalFonts()) {
await queryFontList() // ==> FontData[]
await queryTargetFontBlob('ComicSansMS') // ==> Blob | null
}
in tsconfig.json:
{
"compilerOptions": {
"types": [
"local-font/types"
]
}
}