Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Get font list in specified directory(default system fonts).
This project respect font-manager.
cf.
fontscan | font-manager | |
---|---|---|
native | No, only JS | Yes, made with C |
custom directories | Yes, you can | No, only system fonts |
accuracy | Not good | Good |
speed | Slow | Fast |
Get system fonts.
const fontscan = require('fontscan');
console.log(await fontscan.getFontList());
// output
[
FontDescriptor {
path: 'C:\\Windows\\Fonts\\AGENCYB.TTF',
postscriptName: 'AgencyFB-Bold',
family: 'Agency FB',
monospace: false,
width: 3,
weight: 700,
italic: false,
style: 'Bold'
},
FontDescriptor {
path: 'C:\\Windows\\Fonts\\AGENCYR.TTF',
postscriptName: 'AgencyFB-Reg',
family: 'Agency FB',
monospace: false,
width: 3,
weight: 400,
italic: false,
style: 'Regular'
},
... more items ]
Fonts in specified directory.
Note: We recommend that you do not specify the root directory, as custom directories are searched recursively.
const fonts = await fontscan.getDirectoryFonts('/Library/Fonts');
const fonts = await fontscan.getDirectoriesFonts([
`C:\\Users\\${username}\\Fonts`,
`D:\\Fonts`
]);
fontscan
fontscan.getFontList(options?): Promise<FontDescriptor[]>
Get fontdescriptors that installed and in specified directories.
options
customDirectories
string[]
[]
onlyCustomDirectories
boolean
false
fontscan.getDescriptorFromPaths(fontPaths): Promise<FontDescriptor[]>
Get fontdescriptors that specified files.
fontPaths
string[]
fontscan.getDirectoryFonts(dirPath): Promise<FontDescriptor[]>
Get fontdescriptors that in specified directory.
dirPath
string
fontscan.getDirectoriesFonts(dirPaths): Promise<FontDescriptor[]>
Get fontdescriptors that in specified directories.
dirPaths
string[]
fontscan.getInstalledFonts(): Promise<FontDescriptor[]>
Get fontdescriptors that installed.
FontDescriptor
Font descriptor has basic font informations.
path: string
family: string
postscriptName: string
width: number
weight: number
style: string
Regular
, Bold
, Italic
, Bold italic
italic: boolean
monospace: boolean
npm test
command and confirm that it passesPlease tell me if my English is wrong
FAQs
Get font list in specified directory(default system fonts).
The npm package fontscan receives a total of 2 weekly downloads. As such, fontscan popularity was classified as not popular.
We found that fontscan demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.