// Create text with normal font style
const normalText = new Text({
text: 'Normal Style Text',
style: {
fontStyle: 'normal',
fontSize: 24
}
});
// Create italic text
const italicText = new Text({
text: 'Italic Style Text',
style: {
fontStyle: 'italic',
fontSize: 24,
fontFamily: 'Arial'
}
});
// Create oblique text
const obliqueText = new Text({
text: 'Oblique Style Text',
style: {
fontStyle: 'oblique',
fontSize: 24,
fontFamily: 'Times New Roman'
}
});
// Dynamic style changes
let isItalic = false;
text.style = {
...text.style,
fontStyle: isItalic ? 'italic' : 'normal'
};
Supported values:
The font style input for text styles. Controls the slant or italicization of the text.