Constructor
An object used to load a new font.
Parameters:
Name | Type | Description |
---|---|---|
args |
object | An object used to load a new font. |
Example
const fetcher = name =>
fetch(`https://example.com/${name}`).then(r => {
if (r.status === 200) {
return r.blob();
} else {
throw new Error();
}
});
const customFonts = ["arial.ttf", "helvetica.ttf", "tahoma.ttf"]
.map(font => new PSPDFKit.Font({ name: font, callback: fetcher }));
PSPDFKit.load({
customFonts,
regular options...
}).then(instance => {});
Extends
- Immutable.Record
Members
Members
Non-optional callback to fetch the custom font.
Type:
A unique identifier to name the custom font.
Type:
- string