Class Font
Represents a CSS Font.
Defined in: Font.js.
// Creates a new Font object
var myFont = Font({style: "bold", size: "12px", family: "Tahoma"});
// Creates a new Font with multiple families.
var myFont = Font({style: "bold", size: "12px", family: ["Tahoma", "Arial"]});
// Creates a new Font using convienence method.
var myFont = font("Tahoma", "12px", "bold");
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Font(_details)
|
| Method Attributes | Method Name and Description |
|---|---|
|
toCss()
Creates a CSS string from this Font object.
|
Class Detail
Font(_details)
Author: Eric Berry.
- Parameters:
- _details
- An JSON object containing the following properties:
Property Required Default family no Tahoma size no 12px style no Font.Styles.normal variant no normal weight no Font.Weights.normal
- See:
- Font for more details on the CSS font property.
Method Detail
toCss()
Creates a CSS string from this Font object.
- Returns:
- A String in the format of: "[style] [variant] [weight] [size] [family(ies)]"