// Create text with different font weights
const normalText = new Text({
text: 'Normal Weight',
style: { fontWeight: 'normal' }
});
const boldText = new Text({
text: 'Bold Weight',
style: { fontWeight: 'bold' }
});
// Using numeric weights
const lightText = new Text({
text: 'Light Weight',
style: { fontWeight: '300' }
});
const mediumText = new Text({
text: 'Medium Weight',
style: { fontWeight: '500' }
});
const heavyText = new Text({
text: 'Heavy Weight',
style: { fontWeight: '900' }
});
// Responsive weight changes
const adaptiveText = new Text({
text: 'Adaptive Weight',
style: { fontWeight: window.innerWidth > 600 ? 'bold' : 'normal' }
});
Supported values:
The font weight input for text styles. Controls the thickness or boldness of the text.