When creating a new FontSettings object from scratch, parameters can be passed like follows:
Optional object containing parameters for creation of FontSettings
Get family of font
The list of typeface names / family names.
Get size of font
The size, or height of the font.
Get style of font
The style of the font.
Get variant of font
Small caps or not
Get weight of font
The weight style, or thickness of the font characters.
Create new FontSettings object with different font family.
New FontSettings object.
Create new FontSettings object with different font size.
New FontSettings object.
Create new FontSettings object with different font style.
The style of the font. Options: "normal" | "italic" | "oblique"
New FontSettings object.
Create new FontSettings object with different font variant. The font-variant property specifies whether or not a text should be displayed in a small-caps font.
true selects font-variant: "small-caps", otherwise "normal".
New FontSettings object.
Create new FontSettings object with different font weight.
The weight style, or thickness of the font characters. Options: "normal" | "bold" | "bolder" | "lighter" | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
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.
Class for specifying a font.
Instances of FontSettings are immutable, meaning that its setters don't modify the object, but instead return a completely new modified object.
When creating a new FontSettings object from scratch, parameters can be passed like follows: