Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Agilo/font-loader

Repository files navigation

Font Loader

a lightweight font loader

Install

With npm installed, run

npm install @agilo/font-loader

Usage

Load font via CSS @font-face or any other available method then:

import fontLoader from '@agilo/font-loader';
const font = fontLoader( {
	fontFamily: 'FontFamily',
	fontWeight: 700,
	fontStyle: 'italic',
	timeout: 5000,
} );

font.load()
	.then( () => console.log( 'FontFamily is loaded!' ) )
	.catch( (error) => console.error( error ); );

License

GNU General Public License v2.0