Socket
Book a DemoInstallSign in
Socket

lfa-ponyfill

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lfa-ponyfill

Local Font Access Ponyfill for any environment

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

Local Font Access Ponyfill

Local Font Access API ponyfilled via Google Fonts API. Allows you to use LFA on any environment which supports fetch.

import queryLocalFonts from 'lfa-ponyfill'

// use queryLocalFonts with automatic fallback to remote google fonts
const fonts = await queryLocalFonts({ postscriptNames: ['Roboto', 'Roboto-Bold'] })
const blob = await fonts[0].blob()

const all = await queryLocalFonts() // 3.4k fonts, 1.8k font families!

await queryLocalFonts({ postscriptNames: ['Rosario-Bold-Italic'] }) // specific style
await queryLocalFonts({ postscriptNames: ['rosariobolditalic'] }) // this also works

Or if you don't want a polyfill and explicitly use remote fonts only:

import { queryRemoteFonts } from 'lfa-ponyfill'

// use remote fonts from google
const fonts = await queryRemoteFonts({ postscriptNames: ['Roboto', 'Roboto-Bold'] })
const blob = await fonts[0].blob()

This might not include some very common fonts such as Arial because of licensing!

Most of Google's fonts are under SIL Open Font License.

Keywords

lfa

FAQs

Package last updated on 02 Jun 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