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