1.0.91 • Published 1 year ago

css-fonts v1.0.91

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

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago