6.0.0 • Published 2 years ago

oj-fontloader v6.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

FontLoader

Fonts will be loaded in span tags on the body tag. The spans contain the "font-test". You can apply styling to this class. The fonts MUST be visible in order to load successfully (so no visibility:hidden, display:none or opacity:0)

import

import * as FL from "oj-fontloader"

isLoaded

isFontLoaded(name: string): boolean

FL.isFontLoaded("Bellota")

loadFont

loadFont(name: string, weights: number[] = []): Promise<void>

await FL.loadFont("Bellota", [300, 400, 700])

loadFonts

loadFonts(fonts: { name: string, weights?: number[] }[]): Promise<void>

await FL.loadFonts([
  { name: "Bellota", weights: [300, 400, 700] },
  { name: "Playfair Display", weights: [400] },
])
6.0.0

2 years ago

1.0.2

4 years ago

1.0.1

4 years ago