1.0.91 • Published 5 months ago

css-fonts v1.0.91

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Get system font families

Get a list of system fonts as CSS style organized in their proper families

Example

import getFonts from "css-fonts"

const fonts = await getFonts()

// returns a list like this:
[
    {
        family: 'Arial',
        default: 0,
        fonts: [
            {
                path: '/Fonts/Arial.ttf',
                name: 'Arial',
                style: 'Normal',
                css: "font: normal 400 normal 1em 'Arial';"
            },
            {
                path: '/Fonts/ArialN.ttf',
                name: 'Arial Narrow',
                style: 'Narrow',
                css: "font: normal 400 condensed 1em 'Arial';"
            },
            {
                path: '/Fonts/ArialI.ttf',
                name: 'Arial Cursive',
                style: 'Cursive',
                css: "font: italic 400 normal 1em 'Arial';"
            },
            ...
        ]
    },
    ...
]
1.0.91

5 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago