Styling > Using Cascading Style Sheets > Changing the Font of All Labels

This use case shows you how to configure and change the font of all the labels in your application. It applies to all graphic components.

The label font is configured according to whether the object that is linked to the label is a predefined business object, a user-defined business object, or an attribute.

The following properties are used to configure the label font:

CSS Property 
Type of Value 
Default 
Usage 
labelFont 
Font 
Network and Equipment
Helvetica 12, except: 
- in IltShelf: Helvetica 10 
- in IltShelfItem: Helvetica 11 (Courier New 11 on Windows) 

 
Table and Tree: 
null 
Specifies the font to be used for the label. By default, it is a sans serif font. 
alarmBalloonTextFont 
Font 
Helvetica 12 bold 
Denotes the font used to display the text in the alarm balloon. 
alarmCountFont 
Font 
Helvetica 12 bold 
Denotes the font used in alarm counts displayed in the object base. 
infoWindowTextFont 
Font 
Helvetica 10 
Defines the font of the text displayed in the Information Window. 

The desired configuration is obtained by changing the value of each of these properties through the appropriate CSS selectors. Since you want to see the modification reflected in all objects and attributes, modify these values using the selectors that contain only the CSS type information:

The following example shows the configuration for all user-defined business objects.

How to Configure User-defined Business Objects
object {
    labelFont: "sansserif-PLAIN-12";
}

The following example shows the configuration for all attributes.

How to Configure Attributes in the Table Component Header
attribute {
    labelFont: "sansserif-PLAIN-12"
}

The following example shows the configuration for all predefined business objects.

How to Configure Predefined Business Objects
object."ilog.tgo.model.IltObject" {
    labelFont:"sansserif-PLAIN-12";
    alarmBalloonTextFont:"sansserif-PLAIN-12";
    alarmCountFont:"sansserif-PLAIN-12";
    infoWindowTextFont:"sansserif-PLAIN-12";
}

To have these properties valid for all graphic components, you can use the cascading behavior in the style sheets, so that this style sheet is imported by all the style sheets set in your specific components.

For example, you should first create a style sheet, shared.css, that defines the values of these properties only. Then, you should import this style sheet into each component-specific style sheet with the @import statement:

@import "shared.css";