Construct a FontSettings object, specifying any amount of its properties.
// Example,
const font = new FontSettings({
size: 20,
family: 'Arial, Helvetica, sans-serif',
weight: 'bold',
style: 'italic',
})
Object containing any amount of SolidFill properties.
Get font family.
CSS font family, or list of font families.
For example, 'Arial, Helvetica, sans-serif'.
Font family.
Font size.
Font style.
Font variant.
Font weight.
Create new FontSettings object with different family.
CSS font family, or list of font families.
For example, 'Arial, Helvetica, sans-serif'.
Font family or list of families.
New FontSettings object.
Font size.
New FontSettings object.
Font style.
New FontSettings object.
Create new FontSettings object with different variant.
true = 'small-caps', false = 'normal'
New FontSettings object.
Font weight.
New FontSettings object.
Unlike other types in Immutable.js, the Record() function creates a new
Record Factory, which is a function that creates Record instances.
See above for examples of using Record().
Note: Record is a factory function and not a class, and does not use the
new keyword during construction.
Records allow passing a second parameter to supply a descriptive name that appears when converting a Record to a string or in any error messages. A descriptive name for any record can be accessed by using this method. If one was not provided, the string "Record" is returned.
const { Record } = require('immutable')
const Person = Record({
name: null
}, 'Person')
var me = Person({ name: 'My Name' })
me.toString() // "Person { "name": "My Name" }"
Record.getDescriptiveName(me) // "Person"
True if maybeRecord is an instance of a Record.
Style class for describing a font.
Instances of FontSettings, like all LCJS style classes, are immutable, meaning that its setters don't modify the actual object, but instead return a completely new modified object.
Properties of FontSettings:
size: CSS font size.family: CSS font family, or list of font families.weight: CSS font weight.style: CSS font style.variant: CSS font variant.true= 'small-caps',false= 'normal'.FontSettings usage:
Use FontSettings with:
setFontmethods:// Example 1, set chart title font with explicit font. ChartXY.setTitleFont(new FontSettings({ size: 20, family: 'Arial, Helvetica, sans-serif', weight: 'bold', style: 'italic' })) // Example 2, override chart title font, specifying only a sub-set of properties. ChartXY.setTitleFont((font) => font .setSize(20) )