Effects
Font effects refer to the appearance of the text; that is, whether it is bold, italicized, underlined, and so on.
In the metadata section
To define font effects for an information, question, or categorical response text, include the following in the item’s definition:
labelstyle(font(variable1 = value1 [, ... variablen = valuen]))
where:
▪variable1 to variablen are the names of boolean variables representing the effects.
▪value1 to valuen are True to switch the effect on or False to switch it off.
The boolean variables associated with setting font effects in the metadata section are:
Effect
|
Description
|
IsBold
|
Bold text.
|
IsItalic
|
Italic text.
|
IsOverline
|
Text with a line above it.
|
IsStrikethrough
|
Text with a line through it.
|
IsSubscript
|
Subscripted text.
|
IsSuperscript
|
Superscripted text.
|
IsUnderline
|
Underlined text.
|
If the Sports question is defined as:
Sports6 "Which of the following sports do you play?"
labelstyle (font(IsBold = True)) categorical [1..]
{
Tennis labelstyle(font(IsItalic = True)),
Football labelstyle(font(IsItalic = True)),
Cricket labelstyle(font(IsItalic = True)),
Basketball labelstyle(font(IsItalic = True)),
Hockey labelstyle(font(IsItalic = True))
};
the question text will be displayed in bold and the categorical response texts will be italic, as shown below:
You can define any number of effects for a single text by listing the variable and value pairs one after the other, separated by commas, inside the font parentheses. The statement:
Sports7 "Which of the following sports do you play?"
labelstyle(font(IsBold = True, IsItalic = True))
categorical [1..]
{Tennis, Football, Cricket, Basketball, Hockey};
displays the question text in bold italics and the response texts in the default font.
There are other font settings you can make with labelstyle(font(...)), and you can combine these with font effects. For example:
Sports13 "Which of the following sports do you play?"
labelstyle(font(IsBold=True, Size=12, Family="Times"))
categorical [1..]
{Tennis, Football, Cricket, Basketball, Hockey};
displays the question text in a bold, 12-point, Times font. See
Size and
Typeface for details about these parameters.
In the routing section
You define font effects in the routing section using the Font.Effects property of the Style object. Question, Category (response), and Info (used for banner texts) objects have a Style object, so the statement you would write is as follows:
ObjectName.Label.Style.Font.Effects = FontEffects.effect
where:
▪ObjectName is the name of a question, category (response), or information item.
▪effect is the effect that you want to apply to the named object, and is one of:
Effect | Description |
---|
feBold | Bold text. |
feItalic | Italic text. |
feOverline | Text with a line above it. |
feStrikethrough | Text with a line through it. |
feSubscript | Subscripted text. |
feSuperscript | Superscripted text. |
feUnderline | Underlined text. |
For example:
Sports.Label.Style.Font.Effects = FontEffects.feBold
displays the question text of the Sports question in bold, and:
Sports.Categories[..].Label.Style.Font.Effects =
FontEffects.feItalic
displays the categorical response texts in italic.
You can combine font effects to produce, say, bold, italic or subscripted, underlined text. The easiest way to do this, is to list the font effects you want to apply, separated by plus signs; for example:
Sports.Label.Style.Font.Effects =
FontEffects.feBold + FontEffects.feItalic
for bold italic question text. If you have a default style that uses a combined font effect, you can remove an effect, say, to use italic rather than bold italic text, by subtracting the font you do not want to use.
To turn off or override a default font effect, set Font.Effects to False, Null, or zero.
See also