Skip to content

CSSFontLoadingAPI

Types

fontDisplay

type fontDisplay =
| @as("auto") Auto
| @as("block") Block
| @as("fallback") Fallback
| @as("optional") Optional
| @as("swap") Swap

fontFace

type fontFace = {
mutable family: string,
mutable style: string,
mutable weight: string,
mutable stretch: string,
mutable unicodeRange: string,
mutable featureSettings: string,
mutable display: fontDisplay,
mutable ascentOverride: string,
mutable descentOverride: string,
mutable lineGapOverride: string,
status: fontFaceLoadStatus,
loaded: Promise.t<fontFace>,
}

Record fields

family
string
style
string
weight
string
stretch
string
unicodeRange
string
featureSettings
string
ascentOverride
string
descentOverride
string
lineGapOverride
string
loaded
Promise.t< fontFace >

Module

There are methods and helpers defined in FontFace .

fontFaceDescriptors

type fontFaceDescriptors = {
mutable style?: string,
mutable weight?: string,
mutable stretch?: string,
mutable unicodeRange?: string,
mutable featureSettings?: string,
mutable display?: fontDisplay,
mutable ascentOverride?: string,
mutable descentOverride?: string,
mutable lineGapOverride?: string,
}

Record fields

style
option< string >
weight
option< string >
stretch
option< string >
unicodeRange
option< string >
featureSettings
option< string >
display
option< fontDisplay >
ascentOverride
option< string >
descentOverride
option< string >
lineGapOverride
option< string >

fontFaceLoadStatus

type fontFaceLoadStatus =
| @as("error") Error
| @as("loaded") Loaded
| @as("loading") Loading
| @as("unloaded") Unloaded

fontFaceSet

type fontFaceSet = {
ready: Promise.t<fontFaceSet>,
status: fontFaceSetLoadStatus,
}

Record fields

ready
Promise.t< fontFaceSet >

Module

There are methods and helpers defined in FontFaceSet .

fontFaceSetLoadStatus

type fontFaceSetLoadStatus =
| @as("loaded") Loaded
| @as("loading") Loading