Stylesheet Development with PTC ALD > Adding PTC APP Code to Stylesheet Source > Samples > PTC ALD Properties > Set PTC APP Text Properties > Text Decoration — Lines
  
Text Decoration — Lines
Examples that describe how to set properties for scoring applied to inline text:
Underline
Strikethrough
Overline
Underline
The sample listed here describes how to set properties for underlining applied to a piece of inline text.
Inline text is tagged as emphasis in Arbortext-path/samples/APP/TextProperties/textProperties.xml. Each piece of inline text in the paragraphs in the Underline section have a role=normal underline attribute set, which references the underline property set to provide a single underline to the text.
Each piece of inline text in the section also includes a value for the condition attribute, which in turn relates to a condition of the emphasis everywhere context in the associated stylesheet. Each condition references a different property set, which apply properties such as thickness or offset to the underline:
Style
Thickness
Color
Offset
Symbol at start of underline
Symbol at end of underline
All
Underline style
Attribute value condition="underline style" — condition If attribute "condition"= "underline style" of emphasis everywhere — references property set underlineStyle
The property set configures the underline to use a long dashed line style.
The relevant code from the property set is given below:
style.underlineRule.lineStyle = fRuleLine.LINE_LONGDASH;
The first part of the phrase style.underlineRule.lineStyle specifies that you want to provide a lineStyle property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underLineRule property of the fStyle object, which calls a fTextRule object. lineStyle is a direct property of fTextRule.
The second half = fRuleLine.LINE_LONGDASH calls a fRuleLine object with the value LINE_LONGDASH to specify that the current underline should be drawn in long dashes. Note that LINE_LONGDASH is described in the LineDefinitions group for the fRuleLine object.
Underline thickness
Attribute value condition="underline thickness" — condition IF attribute "condition"= "underline thickness" of emphasis everywhere — references property set underlineThickness
The property set configures the underline as 3pt wide.
The relevant code from the property set is given below:
style.underlineRule.thickness = "3pt";
The first part of the phrase style.underlineRule.thickness specifies that you want to provide a thickness property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underlineRule property of the fStyle object, which calls a fTextRule object. thickness is a direct property of fTextRule.
The second half = "3pt" applies a direct value of 3pt for the thickness property.
The value will be stored as the value property of a fLength object.
Underline color
Attribute value condition="underline colour" — condition ELSE IF attribute "condition"= "underline colour" of emphasis everywhere — references property set underlineColour
The property set configures the underline in orange.
The relevant code from the property set is given below:
style.underlineRule.color = "orange";
The first part of the phrase style.underlineRule.color specifies that you want to provide a color property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underlineRule property of the fStyle object, which calls a fTextRule object. color is a direct property of fTextRule.
The second half = "orange" applies a direct value of orange for the color property. Note the double quotes, which denote that the value should be processed as a string.
Refer to Colors for more information on setting and defining colors.
Offset of underline from baseline
Attribute value condition="underline offset" — condition ELSE IF attribute "condition"= "underline offset" of emphasis everywhere — references property set underlineOffset
The property set configures the underline to be offset at 6pt below the baseline (note that a negative value would draw the underline above the baseline).
The relevant code from the property set is given below:
style.underlineRule.offset = "6pt";
The first part of the phrase style.underlineRule.offset specifies that you want to provide a offset property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underLineRule property of the fStyle object, which calls a fTextRule object. offset is a direct property of fTextRule.
The second half = "6pt" applies a direct value of 6pt for the offset property.
Symbol at start of underline
Attribute value condition="underline start" — condition ELSE IF attribute "condition"= "underline start" of emphasis everywhere — references property set underlineStart
The property set configures the underline to start with the Triangle Style 3 symbol.
The relevant code from the property set is given below:
style.underlineRule.startPattern = fRuleLinePattern.TRIANGLE3;
The first part of the phrase style.underlineRule.startPattern specifies that you want to provide a startPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underLineRule property of the fStyle object, which calls a fTextRule object. startPattern is a direct property of fTextRule.
The second half = fRuleLinePattern.TRIANGLE3 calls a fRuleLinePattern object with the TRIANGLE3 value set to specify that the current underline should start with the triangle style 3 symbol. Note that TRIANGLE3 is defined in the EndPatterns group for fRuleLinePattern.
Symbol at end of underline
Attribute value condition="underline end" — condition ELSE IF attribute "condition"= "underline end" of emphasis everywhere — references property set underlineEnd
The property set configures the underline to end with the Large Dot symbol.
The relevant code from the property set is given below:
style.underlineRule.endPattern = fRuleLinePattern.LARGEDOT;
The first part of the phrase style.underlineRule.endPattern specifies that you want to provide a endPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the underLineRule property of the fStyle object, which calls a fTextRule object. endPattern is a direct property of fTextRule.
The second half = fRuleLinePattern.LARGEDOT calls a fRuleLinePattern object with the LARGEDOT value set to specify that the current underline should end with the large dot symbol. Note that LARGEDOT is defined in the EndPatterns group for fRuleLinePattern.
Set all properties in a single instruction
Attribute value condition="underline change" — condition ELSE IF attribute "condition"= "underline change" of emphasis everywhere — references all six of the property sets mentioned above, to apply all the properties they specify in a single command.
The property set configures the underline 3pt wide, orange, and offset 6pt below the baseline. It is based on the Long Dash style, and will start with the Triangle 3 symbol and end with the Large Dot symbol. It calls the following property sets to configure these properties:
underlineColour
underlineEnd
underlineOffset
underlineStart
underlineStyle
underlineThickness
The property sets are described individually in previous sections.
Note that the first occurrence of emphasis in the section does not include a condition attribute. This is to provide a control sample, which demonstrates the appearance of the underline before the new properties are configured.
Strikethrough
The sample listed here describes how to set properties for strikethrough applied to a piece of inline text.
Inline text is tagged as emphasis in Arbortext-path/samples/APP/TextProperties/textProperties.xml. Each piece of inline text in the paragraphs in the Strikethrough section have a role=normal strikethrough attribute set, which references the strikethrough property set to provide a single strikethrough line to the text.
Each piece of inline text in the section also includes a value for the condition attribute, which in turn relates to a condition of the emphasis everywhere context in the associated stylesheet. Each condition references a different property set, which apply properties such as thickness or offset to the strikethrough:
Style
Thickness
Color
Offset
Symbol at start of underline
Symbol at end of underline
All
Strikethough line style
Attribute value condition="strikethrough style" — condition If attribute "condition"= "strikethrough style" of emphasis everywhere — references property set strikethroughStyle
The property set configures the strikethrough to use a long dashed line style.
The relevant code from the property set is given below:
style.strikethroughRule.lineStyle = fRuleLine.LINE_LONGDASH;
The first part of the phrase style.strikethroughRule.lineStyle specifies that you want to provide a lineStyle property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. lineStyle is a direct property of fTextRule.
The second half = fRuleLine.LINE_LONGDASH calls a fRuleLine object with the value LINE_LONGDASH to specify that the current strikethrough should be drawn in long dashes. Note that LINE_LONGDASH is described in the LineDefinitions group for the fRuleLine object.
Strikethough line thickness
Attribute value condition="strikethrough thickness" — condition IF attribute "condition"= "strikethrough thickness" of emphasis everywhere — references property set strikethroughThickness
The property set configures the underline as 3pt wide.
The relevant code from the property set is given below:
style.strikethroughRule.thickness = "3pt";
The first part of the phrase style.strikethroughRule.thickness specifies that you want to provide a thickness property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. thickness is a direct property of fTextRule.
The second half = "3pt" applies a direct value of 3pt for the thickness property.
The value will be stored as the value property of a fLength object.
Strikethrough line color
Attribute value condition="strikethrough colour" — condition ELSE IF attribute "condition"= "strikethrough colour" of emphasis everywhere — references property set strikethroughColour
The property set configures the strikethrough line in purple.
The relevant code from the property set is given below:
style.strikethroughRule.color = "purple";
The first part of the phrase style.strikethroughRule.color specifies that you want to provide a color property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. color is a direct property of fTextRule.
The second half = "purple" applies a direct value of purple for the color property. Note the double quotes, which denote that the value should be processed as a string.
The value will be stored as the name property of a fColor object.
Offset of underline from baseline
Attribute value condition="strikethrough offset" — condition ELSE IF attribute "condition"= "strikethrough offset" of emphasis everywhere — references property set strikethroughOffset
The property set configures the strikethrough line to be drawn at 6pt above the baseline (note that a positive value would draw the underline below the baseline).
The relevant code from the property set is given below:
style.strikethroughRule.offset = "-6pt";
The first part of the phrase style.strikethroughRule.offset specifies that you want to provide an offset property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. offset is a direct property of fTextRule.
The second half = "-6pt"; applies a direct value of –6pt for the offset property.
The value will be stored as the value property of a fLength object.
Symbol at start of strikethough line
Attribute value condition="strikethrough start" — condition ELSE IF attribute "condition"= "underline start" of emphasis everywhere — references property set strikethroughStart
The property set configures the strikethrough line to start with the Triangle Style 3 symbol.
The relevant code from the property set is given below:
style.strikethroughRule.startPattern = fRuleLinePattern.TRIANGLE3;
The first part of the phrase style.strikethroughRule.startPattern specifies that you want to provide a startPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. startPattern is a direct property of fTextRule.
The second half = fRuleLinePattern.TRIANGLE3 calls a fRuleLinePattern object with the TRIANGLE3 value set to specify that the current strikethrough should start with the triangle style 3 symbol. Note that TRIANGLE3 is defined in the EndPatterns group for fRuleLinePattern.
Symbol at end of strikethrough line
Attribute value condition="strikethrough end" — condition ELSE IF attribute "condition"= "strikethrough end" of emphasis everywhere — references property set strikethroughEnd.
The property set configures the strikethrough line to end with the Large Dot symbol.
The relevant code from the property set is given below:
style.strikethroughRule.endPattern = fRuleLinePattern.LARGEDOT;
The first part of the phrase style.strikethroughRule.endPattern specifies that you want to provide a endPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the strikethroughRule property of the fStyle object, which calls a fTextRule object. endPattern is a direct property of fTextRule.
The second half = fRuleLinePattern.LARGEDOT calls a fRuleLinePattern object with the LARGEDOT value set to specify that the current underline should end with the large dot symbol. Note that LARGEDOT is defined in the EndPatterns group for fRuleLinePattern.
Set all properties in a single instruction
Attribute value condition="strikethrough change" — condition ELSE IF attribute "condition"= "strikethrough change" of emphasis everywhere — references all six of the property sets mentioned above, to apply all the properties they specify in a single command.
The property set configures the underline 3pt wide, purple, and offset 6pt above the baseline. It is based on the Long Dash style, and will start with the Triangle 3 symbol and end with the Large Dot symbol. It calls the following property sets to configure these properties:
strikethroughColour
strikethroughEnd
strikethroughOffset
strikethroughStart
strikethroughStyle
strikethroughThickness
The property sets are described individually in previous sections.
Note that the first occurrence of emphasis in the section does not include a condition attribute. This is to provide a control sample, which demonstrates the appearance of the underline before the new properties are configured.
Overline
The sample listed here describes how to set properties for overline applied to a piece of inline text.
Inline text is tagged as emphasis in Arbortext-path/samples/APP/TextProperties/textProperties.xml. Each piece of inline text in the paragraphs in the Overline section have a role=normal overline attribute set, which references the overline property set to provide a single strikethrough line to the text.
Each piece of inline text in the section also includes a value for the condition attribute, which in turn relates to a condition of the emphasis everywhere context in the associated stylesheet. Each condition references a different property set, which apply properties such as thickness or offset to the overline:
Style
Thickness
Color
Offset
Symbol at start of underline
Symbol at end of underline
All
Overline line style
Attribute value condition="overline style" — condition If attribute "condition"= "overline style" of emphasis everywhere — references property set overlineStyle
The property set configures the overline to use a diamond line style.
The relevant code from the property set is given below:
style.overlineRule.lineStyle = fRuleLine.LINE_DIAMOND;
The first part of the phrase style.overlineRule.lineStyle specifies that you want to provide a lineStyle property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. lineStyle is a direct property of fTextRule.
The second half = fRuleLine.LINE_DIAMOND calls a fRuleLine object with the value LINE_DIAMOND to specify that the current strikethrough should be drawn in diamonds. Note that LINE_DIAMOND is described in the LineDefinitions group for the fRuleLine object.
Overline thickness
Attribute value condition="overline thickness" — condition IF attribute "condition"= "overline thickness" of emphasis everywhere — references property set overlineThickness
The property set configures the underline as 4pt wide.
The relevant code from the property set is given below:
style.overlineRule.thickness = "4pt";
The first part of the phrase style.overlineRule.thickness specifies that you want to provide a thickness property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. thickness is a direct property of fTextRule.
The second half = "4pt" applies a direct value of 4pt for the thickness property.
The value will be stored as the value property of a fLength object.
Overline color
Attribute value condition="overline colour" — condition ELSE IF attribute "condition"= "overline colour" of emphasis everywhere — references property set overlineColour
The property set configures the overline in magenta.
The relevant code from the property set is given below:
style.overlineRule.color = "magenta";
The first part of the phrase style.overlineRule.color specifies that you want to provide a color property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. color is a direct property of fTextRule.
The second half = "magenta" applies a direct value of magenta for the color property. Note the double quotes, which denote that the value should be processed as a string.
The value will be stored as the name property of a fColor object.
Offset of overline from baseline
Attribute value condition="overline offset" — condition ELSE IF attribute "condition"= "overline offset" of emphasis everywhere — references property set overlineOffset
The property set configures the overline to be drawn at 13pt above the baseline (note that a positive value would draw the underline below the baseline).
The relevant code from the property set is given below:
style.overlineRule.offset = "-13pt";
The first part of the phrase style.overlineRule.offset specifies that you want to provide an offset property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. offset is a direct property of fTextRule.
The second half = "-13pt"; applies a direct value of –13pt for the offset property.
The value will be stored as the value property of a fLength object.
Symbol at start of overline
Attribute value condition="overline start" — condition ELSE IF attribute "condition"= "overline start" of emphasis everywhere — references property set overlineStart
The property set configures the overline to start with the Arrow 6 symbol.
The relevant code from the property set is given below:
style.overlineRule.startPattern = fRuleLinePattern.ARROW6;
The first part of the phrase style.overlineRule.startPattern specifies that you want to provide a startPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. startPattern is a direct property of fTextRule.
The second half fRuleLinePattern.ARROW6 calls a fRuleLinePattern object with the ARROW6 value set to specify that the current strikethrough should start with the Arrow symbol, style 6. Note that ARROWW6 is defined in the EndPatterns group for fRuleLinePattern.
Symbol at end of overline
Attribute value condition="overline end" — condition ELSE IF attribute "condition"= "overline end" of emphasis everywhere — references property set overlineEnd.
The property set configures the strikethrough line to end with the Large Box symbol.
The relevant code from the property set is given below:
style.overlineRule.endPattern = fRuleLinePattern.LARGEBOX;
The first part of the phrase style.overlineRule.endPattern specifies that you want to provide an endPattern property to the fStyle object that applies the current styling to the inline text. That property is resolved from the overlineRule property of the fStyle object, which calls a fTextRule object. endPattern is a direct property of fTextRule.
The second half = fRuleLinePattern.LARGEBOX calls a fRuleLinePattern object with the LARGEBOX value set to specify that the current underline should end with the large box symbol. Note that LARGEBOX is defined in the EndPatterns group for fRuleLinePattern.
Set all properties in a single instruction
Attribute value condition="overline change" — condition ELSE IF attribute "condition"= "overline change" of emphasis everywhere — references all six of the property sets mentioned above, to apply all the properties they specify in a single command.
The property set configures the overline 4pt wide, magenta, and offset 13pt above the baseline. It is based on the Diamond style, and will start with the Arrow 6 symbol and end with the Large Box symbol. It calls the following property sets to configure these properties:
overlineColour
overlineEnd
overlineOffset
overlineStart
overlineStyle
overlineThickness
The property sets are described individually in previous sections.
Note that the first occurrence of emphasis in the section does not include a condition attribute. This is to provide a control sample, which demonstrates the appearance of the underline before the new properties are configured.