1.0.91 • Published 8 months ago

css-fonts v1.0.91

Weekly downloads
-
License
ISC
Repository
github
Last release
8 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

8 months ago

1.0.9

9 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago