Const
Advanced
A loader plugin for handling web fonts
The asset alias identifies the font in Assets; it is not the CSS font family. Use the data.family value (or the loaded FontFace.family) as the fontFamily in a text style. Without data.family, the family is derived from the font file name.
data.family
FontFace.family
fontFamily
used for deprecation purposes
Optional
import { Assets, Text } from 'pixi.js';await Assets.load({ alias: 'font', src: 'fonts/titan-one.woff', data: { family: 'Titan One' },});const text = new Text({ text: 'Hello', style: { fontFamily: 'Titan One' } }); Copy
import { Assets, Text } from 'pixi.js';await Assets.load({ alias: 'font', src: 'fonts/titan-one.woff', data: { family: 'Titan One' },});const text = new Text({ text: 'Hello', style: { fontFamily: 'Titan One' } });
A loader plugin for handling web fonts
The asset alias identifies the font in Assets; it is not the CSS font family. Use the
data.familyvalue (or the loadedFontFace.family) as thefontFamilyin a text style. Withoutdata.family, the family is derived from the font file name.