RasCarlito / node-font-list

Get the list of fonts installed in the system.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

font-list

font-list is a Node.js package for listing the fonts available on your system.

Current version supports MacOS, Windows, and Linux.

Install

npm install font-list

Usage

const fontList = require('font-list')

fontList.getFonts()
  .then(fonts => {
    console.log(fonts)
  })
  .catch(err => {
    console.log(err)
  })

The return value fonts is an Array, looks like:

[ '"Adobe Arabic"',
  '"Adobe Caslon Pro"',
  '"Adobe Devanagari"',
  '"Adobe Fan Heiti Std"',
  '"Adobe Fangsong Std"',
  'Arial',
  ...
  ]

If the font name contains spaces, the name will be wrapped in double quotes, otherwise there will be no double quotes, for example: '"Adobe Arabic"', 'Arial'.

About

Get the list of fonts installed in the system.

License:MIT License


Languages

Language:JavaScript 87.6%Language:VBScript 9.4%Language:Objective-C 2.9%