New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

css-fonts

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-fonts

Get system fonts organized by family

latest
Source
npmnpm
Version
1.0.92
Version published
Maintainers
1
Created
Source

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';"
            },
            ...
        ]
    },
    ...
]

Keywords

css

FAQs

Package last updated on 22 May 2025

Did you know?

Socket

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.

Install

Related posts